phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 429 forks source link

grumphp stuck on php/grumphp:1.5.1, because Magento still uses symfony/console:~4.4.0 #1029

Closed leonhelmus closed 2 years ago

leonhelmus commented 2 years ago
Q A
Version vendor/bin/grumphp -V
Bug? no
New feature? no
Question? yes
Documentation? no
Related tickets comma-separated list of related tickets

php/grumphp is stuck on version 1.5.1, because magento/framework has a dependency on symfony/console:~4.4.0. See composer show magento/framework.

name     : magento/framework
descrip. : N/A
keywords : 
versions : * 103.0.4-p1
type     : magento2-library
license  : Open Software License 3.0 (OSL-3.0) (OSI approved) https://spdx.org/licenses/OSL-3.0.html#licenseText
license  : Academic Free License v3.0 (AFL-3.0) (OSI approved) https://spdx.org/licenses/AFL-3.0.html#licenseText
homepage : 
source   : []  
dist     : [zip] https://repo.magento.com/archives/magento/framework/magento-framework-103.0.4.0-patch1.zip 
path     : /home/leonhelmus/docker/magento2/2.4.4-p1/2.4.4-p1-enterprise/vendor/magento/framework
names    : magento/framework

autoload
files
psr-4
Magento\Framework\ => .

requires
colinmollenhour/php-redis-session-abstract ~1.4.5
composer/composer ^1.9 || ^2.0
ext-bcmath *
ext-curl *
ext-dom *
ext-gd *
ext-hash *
ext-iconv *
ext-intl *
ext-openssl *
ext-simplexml *
ext-sodium *
ext-xsl *
guzzlehttp/guzzle ^7.3.0
laminas/laminas-code ~4.5.0
laminas/laminas-escaper ~2.9.0
laminas/laminas-http ^2.15.0
laminas/laminas-mail ^2.15.1
laminas/laminas-mime ^2.9.1
laminas/laminas-stdlib ^3.6.0
laminas/laminas-uri ^2.9.1
laminas/laminas-validator ^2.15.0
lib-libxml *
magento/composer-dependency-version-audit-plugin ~0.1
magento/zendframework1 ~1.15.0
monolog/monolog ^2.7
php ~7.4.0||~8.1.0
ramsey/uuid ~4.2.0
symfony/console ~4.4.0
symfony/process ~4.4.0
tedivm/jshrink ~1.4.0
webonyx/graphql-php ~14.11.3
wikimedia/less.php ^3.0.0

suggests
ext-imagick Use Image Magick >=3.0.0 as an optional alternative image processing library

This is the reason why you can never install a higher version of grumphp in a magento than 1.5.1. Is it possible to add a dependency to composer.json (https://github.com/phpro/grumphp/blob/master/composer.json#L31)? like

"symfony/console": "~4.4.0||~5.3 || ~6.0",

instead of:

"symfony/console": "~5.3 || ~6.0",

Or would this introduce breaking changes?

My configuration

# grumphp.yml
# Please add a copy of your grumphp.yml file.

Steps to reproduce: composer require --dev phpro/grumphp in a magento 2.4.5 project

Result:

it requires phpro/grumphp:1.5.1 instead of the latest version.
veewee commented 2 years ago

See https://github.com/phpro/grumphp/issues/1028#issuecomment-1199231004

I recommend using the phar version instead.

We will only support 2 major symfony version, because that's about all the pain I can bare maintaining in my spare time. Maybe you have better luck asking the magento team to get their dependencies a bit more up to date.

leonhelmus commented 2 years ago

Hehehe, thanks i can get behind that :+1: Some collegues showed me that as well. Thanks for this project non the less!