New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHAR file for each release #110
Comments
You can currently solve this by installing and using PHPStan globally in your system. This is supported and even with a nice autoloader autodiscovery feature: https://github.com/phpstan/phpstan#autoloading-for-global-installation I plan to release PHARs regularly once this known issue is solved:
|
You can also use this for class conflict: https://github.com/webmozart/php-scoper Related PHPUnit issue: sebastianbergmann/phpunit#2015 |
@markwatney2016 |
👍 for phar files. |
@ondrejmirtes I'd like to add phpstan to CI of all my packages, but the conflicting dependencies with Nette are a problem for me. As you know, we spoke about generating phar and prefixing phpstan dependencies earlier. Do you have in mind a specific way of generating the phar? I need this solved in the following two or three weeks, so I'm open to suggestions and willing to send a PR. |
@fprochazka Which dependencies exactly cause you to conflict? I can loosen the version constraints if it helps you. What I'd need to be able to create PHAR files is to have a tool similar to https://github.com/webmozart/php-scoper. I need to prefix all 3rd party dependencies (all used namespaces except for I can create a PHAR package without prefixing the namespaces, but that doesn't solve the issue of conflicting dependencies versions - if there's something different in a used library when compared to the PHPStan's version, it will likely report some false positives because PHPStan will use the reflection of the version it uses, not of the analyzed project. That's why I want to prefix the dependencies. |
not sure that is the exact problem, but i tried to use via docker, and the fact that this tool seems to load vendor/ from project causes issues because i have different symfony version installed (and can't change that). can the tool not load vendor/autoload? because if it does, it doesn't matter how phpstan is installed (phar or docker or composer global) the symbol errors will occour.
ps: for building .phar itself, i recommend box: https://github.com/box-project/box2 |
I've started working on https://github.com/fprochazka/phpstan-compiler. It solves both creating a phpstan-0.6.4.phar
You should be able to load extenion configs using phpstan-master.phar
The extensions are not compatible with master, so there are none at the moment in this build. |
I just released PHPStan 0.7 which includes a PHAR archive :) See the release notes for details. |
What is the extension story when using the PHAR or phpstan-shim? What about when installing locally vs globally? Maybe there can be better clarification in the README with examples... |
@teohhanhui the compiler should be ready for the extensions, but - phpstan/phpstan-shim#2 (comment) If you wanna, you might be able to compile the |
Okay, back to the old way of installing locally it is then. |
Would be very handy if there was a PHAR file for every release especially if you want to analyze projects that run on PHP < 7 because in those projects you can not require
phpstan/phpstan
in the rootcomposer.json
of the project you would like to analyze.The text was updated successfully, but these errors were encountered: