-
Notifications
You must be signed in to change notification settings - Fork 4
Not bundled extensions #1
Comments
I solved this by turning off prefixing for PhpParser which is a fine solution because the prefixing won't be needed in the foreseeable future thanks to static reflection. For now, I think it's fine. I plan to create a repo at |
@ondrejmirtes what's the status on your latest comment ? Have solutions changed in the meantime around this issue ? (I'm facing the same one in Rector and investigating it) |
This is a totally obsolete thread and even the whole repository. PHPStan compiler lived at phpstan/phpstan-compiler for a while and is now inside phpstan/phpstan-src. Built from the ground up using humbug/box and humbug/php-scoper. You can use the PHAR version of PHPStan with With PHPStan 0.12 released later this year, |
What are the reasons behind that? It's very useful for me to sometimes open phpstan's source code to either see how it works or mess around with it occasionally to check if I can easily fix the bug I encounter (usually resulting in a bugfix PR for you). If composer installs a PHAR instead, it will be much more difficult for me to contribute. |
Basically the main reason is that the latest version will be usable by more people, not creating conflicts in Composer. It was discussed here: phpstan/phpstan#2074 |
Since contributing always requires to create a small reproducing example and write a test, you should do it independently in phpstan-src directory on your hard drive. If you want to try your changes before submitting them as PR, you can compile your own PHAR and copy it over the officially installed one in the project where you use PHPStan, and run it. |
The phar should include some "aliasing autoloader", that would alias prefixed classes back to their original, when the project doesn't have the dependency installed. This has to be really carefully done, with checking the project's autoloader instance, to not create the original problem, that this compiler aims to solve.
For example somebody installs a custom extension, that is not bundled (and therefore it doesn't contain prefixed
PhpParser
references) - it should still work. Now it wouldn't, because the runtime only contains the prefixed classes and the extesion wont.The text was updated successfully, but these errors were encountered: