Is a .phar build planned for this tool? I would be interested. :-)
Why not :)
I like this approach: https://github.com/phpstan/phpstan-shim
Well, as I can have a link for a wget, I'm ok. :stuck_out_tongue:
Let's do this then :) could you prepare such repository and test it?
We can move the repo here afterwards and generate phar to GitHub pagest
Not sure to get time to learn how to build a .phar now. But if nobody does it, I'll do it one time.
About the .phar story. What is the interest of a -shim repository? Why not publish the phar on a website or on the release file instead like php-cs-fixer?
I think it's composer update approach. Install and forget.
I never update my phar deps
Feel free to re-open with PR or reference to demo repository.
Closing now to keep only valid issues open only
Reoped due to: https://github.com/rectorphp/rector/issues/302#issuecomment-361648078
I'm making this priority, since the bin plugin doesn't work as expected
Once we have phar support could we add this to phive?
Sure. The phar is on hold now, I could not make it.
Any help is appreciated
As discusses @mssimi over hangouts, think of prefixing only:
Tried php-scoper atm I cannot whitelist namespace easily.
https://github.com/humbug/php-scoper/issues/192
Edit: Does not prefix config files either.
I'd consider using it as it cover 80 % cases.
The rest need to be resolve our way:
php-scoper: "Rector" => "Prefix123Rector"sed in cli to original stateWhat issues did you face when creating the phar?
See https://github.com/rectorphp/rector/pull/389/files/cadcd379d31270f499d4df774a55b7630ff021f9#diff-197bb7611c620867d2f3cd1c34653e92
Why/how create the compiler?
Where to start
phpstan-compiler isn't closed source, it was moved to phpstan/phpstan-src. See my tweet: https://twitter.com/OndrejMirtes/status/1191608448049451009
I've updated the link.
Btw, how can Rector use PHPStan now without requiring whole prefixed phar? I didn't find https://packagist.org/?query=phpstan-src on packagist :/
It should work exactly the same way for you. I encourage you to try to build Rector on top of phpstan/phpstan dev-master.
The problem is, most of vendor will be duplicated/prefixed.
To prefix Rector correctly using PHPStan's vendor, we would need to know the prefix string. It's not possible now
I don’t get it. PHPStan itself and nikic/php-parser aren’t prefixed. As PHPStan user (even of internals like types or Scope), you don’t have to care about the generated prefix of for example symfony/console. You’re not supposed to touch it.
There is symfony/console in PHPStan - prefixed,
and one in Rector - currently not prefixed.
That means almost double the load of files in vendor compared to shared dependencies - now.
I don't see the problem in practice.
That means almost double the load of files in vendor compared to shared dependencies - now.
There's going to be only one PHPStan file (the .phar) in vendor so this statement isn't true.
It is, PHPStan (the .phar with prefixed) + Rector's vendor.
The best solution to keep file load same as now would be to have phpstan-src on Packagist, as was phpstan before.
But why? Just try it and see that it works. No one cares about 5 more megabytes to download. It's better longterm like this.
Basically the main reason for the PHAR is that the latest version will be usable by more people, not creating conflicts in Composer. It was discussed here: phpstan/phpstan#2074
Thanks for the link. It looked very random with commit and no PR to master.
Just try it and see that it works. No one cares about 5 more megabytes to download. It's better longterm like this.
I don't mind that much, but not sure about the community. I'll refer people to this if they complain :)
The solution is closer than ever before... :)
https://github.com/rectorphp/rector/pull/2373
We got to overcome handful Symfony bugs at first, but now it looks good
Resolved by https://github.com/rectorphp/rector/pull/2373
Download and test at https://github.com/rectorphp/rector-prefixed
Most helpful comment
The solution is closer than ever before... :)
https://github.com/rectorphp/rector/pull/2373
We got to overcome handful Symfony bugs at first, but now it looks good