Skip to main content


Is my search-fu leaving me, or is there no PHAR for Rector?
in reply to Senior Rabbit-Hole Explorer

@heiglandreas then it's not just me. that is a shame, because Rector requires PHPStan, so my effort to use PHARs for the QA tools is sort of moot then
in reply to Skoop (Stefan Koopmanschap)

That is the "problem" with PHARs. They are great for standalone tools. But as soon as you need plugins, dependencies or whatever, you get either into a lot of trouble or .. let's not discuss the OR...
in reply to Senior Rabbit-Hole Explorer

The biggest hinderer for PHARs is IMO the "let's just use dev-dependencies in composer" attitude...

And opinions.

in reply to Senior Rabbit-Hole Explorer

Which is why I tend to lean more and more towards Marcos approach to use tool-specific composer.json files
in reply to Sven

@sven It shouldn't be. As it's even more complex than having to use a different tool.

But in times of developers not being capable of using 2 different tools for 2 different things it looks like it's the way people go.

It's not DRY, it's using wrong abstractiosn. But .... 🤷

/cc @Skoop

in reply to Senior Rabbit-Hole Explorer

@heiglandreas @sven Right now, I'm leaning towards using Phive to install PHPUnit, PHP CS Fixer, PHPStan. And using a separate composer.json for Rector, which may install PHPStan, but that will only be for Rector, I'd use the PHAR for actually running PHPStan.
in reply to Skoop (Stefan Koopmanschap)

@sven Depending on how Rector calls PHPStan you can even use the `replace` config inside the composer.json to make it not install PHPStan and then use PHPStan from the tools-directory...

roughly speaking...

@Sven
in reply to Skoop (Stefan Koopmanschap)

@heiglandreas @sven Okay, that's a lame excuse he wrote there, tbh.

There is no need to "manually update files".

We could also consider creating a phar-io update wrapper component that allows for an easy "--self-update" process to be included.

in reply to Skoop (Stefan Koopmanschap)

I feel you. There's always one piece of the puzzle that does not work the I want things to work which then makes my whole idea pointless /cc @heiglandreas
in reply to Skoop (Stefan Koopmanschap)

I guess there is none, as rector package is delivered as a shim only requiring a specific phpstan version: https://packagist.org/packages/rector/rector So it already is like a phar shipped as composer package in some way.
in reply to Daniel Siepmann

@danielsiepmann but that's the thing: we're doing a lot of upgrades right now, and dependency-issues are the biggest problem we run into. mostly issues with dependencies of dev-tools. so I was hoping to put all QA/analysis tools as PHARs to minimize those issues. Everything is a PHAR, but not rector. and that requires PHPStan again. Opening up the issues again.
in reply to Skoop (Stefan Koopmanschap)

I guess because phpstan already follows the same approach …

I don't think you will get phar from official rector: https://github.com/rectorphp/rector/issues/7824 I'm sorry.