Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active December 10, 2023 10:11
Show Gist options
  • Save fedir/b2cfbbee7ed13f26d916391b1004a197 to your computer and use it in GitHub Desktop.
Save fedir/b2cfbbee7ed13f26d916391b1004a197 to your computer and use it in GitHub Desktop.
phpstan install globally as phar
wget -O phpstan.phar https://github.com/phpstan/phpstan/raw/HEAD/phpstan.phar
chmod a+x phpstan.phar
sudo mv phpstan.phar /usr/local/bin/phpstan
phpstan
@alexandrecruz
Copy link

With the release of PHPStan 0.12, the primary Composer package used by most users,
phpstan/phpstan, has switched to a PHAR file. It works the same way as phpstan-shim.
The need for a separate PHAR distribution has ceased.
Package phpstan/phpstan-shim is no longer needed.

Simply, replace the .phar file path with the folowing one: wget -O phpstan.phar https://github.com/phpstan/phpstan-shim/raw/master/phpstan.phar and you should be good :)

@EvilGoTa
Copy link

replace first command to wget -O phpstan.phar https://github.com/phpstan/phpstan/raw/master/phpstan.phar to install the latest phpstan

@jens-struct
Copy link

it is now wget -O phpstan.phar https://github.com/phpstan/phpstan/raw/HEAD/phpstan.phar

@wbswbs
Copy link

wbswbs commented Nov 11, 2023

Should be changed for PHP 8 to

wget -O phpstan.phar https://github.com/phpstan/phpstan/raw/HEAD/phpstan.phar
chmod a+x phpstan.phar
sudo mv phpstan.phar /usr/local/bin/phpstan
phpstan

@fedir
Copy link
Author

fedir commented Nov 11, 2023

Updated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment