schmunk42 / yii2-giiant

Yii 2 Framework Code Generator Gii on Steroids
271 stars 120 forks source link

Moved "friendsofphp/php-cs-fixer" to "require-dev" in composer #281

Closed rhertogh closed 2 years ago

rhertogh commented 2 years ago

Currently the "friendsofphp/php-cs-fixer" is specified in composer's "require" section. This blocks the use of php-cs-fixer version 3 in other projects. Unless it's used in the code somewhere (I couldn't fiend any place) it should be specified in "require-dev".

schmunk42 commented 2 years ago

Why does having it in require block the usage in other projects ... or why does require-dev solve this?

It is used here: https://github.com/schmunk42/yii2-giiant/blob/c18c83fe1cd827ad0c0d546b1679028f0f39dd90/src/generators/crud/Generator.php#L424-L428

One could argue, that Giiant itself is just a dev tool.

rhertogh commented 2 years ago

One could argue, that Giiant itself is just a dev tool.

Yes, we indeed only use it in our "require-dev" section. But composer only installs dependencies from the "require" section of packages that are defined in the base composer.json (and ignores those in "require-dev"). In our base composer.json we would like to include version 3 of php-cs-fixer, which is now blocked by Giiant.

I thought Giant used php-cs-fixer only as a dev package, the quickest (and based on that assumption, correct) way to fix it would have been to move it to the "require-dev" section. But since Giiant actually depends on the php-cs-fixer it's correctly located in the "require" section.