mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Add support for phan/phan
This commit is contained in:
parent
a48ff666f8
commit
b1776b79c8
@ -131,7 +131,7 @@ with:
|
||||
|
||||
These tools can be setup globally using the `tools` input.
|
||||
|
||||
`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli`
|
||||
`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phan`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli`
|
||||
|
||||
```yaml
|
||||
uses: shivammathur/setup-php@v2
|
||||
|
@ -391,7 +391,7 @@ describe('Tools tests', () => {
|
||||
});
|
||||
it('checking addTools on darwin', async () => {
|
||||
const script: string = await tools.addTools(
|
||||
'blackfire, blackfire-player, flex, infection, phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, vapor-cli, phive:1.2.3, cs2pr:1.2.3, composer-prefetcher:1.2.3, phpize, php-config, symfony, symfony:1.2.3, wp-cli',
|
||||
'blackfire, blackfire-player, flex, infection, phan, phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, vapor-cli, phan:2.7.2, phive:1.2.3, cs2pr:1.2.3, composer-prefetcher:1.2.3, phpize, php-config, symfony, symfony:1.2.3, wp-cli',
|
||||
'7.4',
|
||||
'darwin'
|
||||
);
|
||||
@ -408,6 +408,9 @@ describe('Tools tests', () => {
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection'
|
||||
);
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan'
|
||||
);
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs'
|
||||
);
|
||||
@ -426,6 +429,9 @@ describe('Tools tests', () => {
|
||||
expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/');
|
||||
expect(script).toContain('add_composertool flex flex symfony/');
|
||||
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/phan/phan/releases/download/2.7.2/phan.phar phan'
|
||||
);
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
|
||||
);
|
||||
|
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -1987,6 +1987,10 @@ async function addTools(tools_csv, php_version, os_version) {
|
||||
url = github + 'squizlabs/PHP_CodeSniffer/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'phan':
|
||||
url = github + 'phan/phan/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'phive':
|
||||
script += await addPhive(version, os_version);
|
||||
break;
|
||||
|
@ -118,6 +118,9 @@ add_tool() {
|
||||
if [ -n "$COMPOSER_TOKEN" ]; then
|
||||
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
|
||||
fi
|
||||
elif [ "$tool" = "phan" ]; then
|
||||
add_extension fileinfo "sudo pecl install -f fileinfo" extension >/dev/null 2>&1
|
||||
add_extension ast "sudo pecl install -f ast" extension >/dev/null 2>&1
|
||||
elif [ "$tool" = "phive" ]; then
|
||||
add_extension curl "sudo pecl install -f curl" extension >/dev/null 2>&1
|
||||
add_extension mbstring "sudo pecl install -f mbstring" extension >/dev/null 2>&1
|
||||
|
@ -219,6 +219,9 @@ add_tool() {
|
||||
fi
|
||||
elif [ "$tool" = "cs2pr" ]; then
|
||||
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
|
||||
elif [ "$tool" = "phan" ]; then
|
||||
add_extension fileinfo "$apt_install php$version-fileinfo" extension >/dev/null 2>&1
|
||||
add_extension ast "$apt_install php-ast" extension >/dev/null 2>&1
|
||||
elif [ "$tool" = "phive" ]; then
|
||||
add_extension curl "$apt_install php$version-curl" extension >/dev/null 2>&1
|
||||
add_extension mbstring "$apt_install php$version-mbstring" extension >/dev/null 2>&1
|
||||
|
@ -165,7 +165,10 @@ Function Add-Tool() {
|
||||
Add-Content -Path $current_profile -Value "New-Alias $tool $php_dir\$tool.bat" >$null 2>&1
|
||||
} catch { }
|
||||
}
|
||||
if($tool -eq "phive") {
|
||||
if($tool -eq "phan") {
|
||||
Add-Extension fileinfo >$null 2>&1
|
||||
Add-Extension ast >$null 2>&1
|
||||
} elseif($tool -eq "phive") {
|
||||
Add-Extension xml >$null 2>&1
|
||||
} elseif($tool -eq "cs2pr") {
|
||||
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
|
||||
|
@ -463,6 +463,10 @@ export async function addTools(
|
||||
url = github + 'squizlabs/PHP_CodeSniffer/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'phan':
|
||||
url = github + 'phan/phan/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'phive':
|
||||
script += await addPhive(version, os_version);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user