Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Please loosen version requirement #152

Closed
jurgenhaas opened this issue Nov 3, 2017 · 4 comments
Closed

Please loosen version requirement #152

jurgenhaas opened this issue Nov 3, 2017 · 4 comments

Comments

@jurgenhaas
Copy link

This is an issue with dependency requirements incompatibility. Your package sebastian/phpcpd requires sebsatian/version ^2 which differs from the 1.x version only with regard to the PHP version requirement and some smaller code improvements.

My problem is, coming from the Drupal community, that I would like to use e.g. dealerdirect/qa-tools which requires sebastian/phpcpd and therefore requires sebastian/version ^2. Drupal itself (as of Drupal 8.5.x) requires phpunit >=4.8.5 < 5, and, as previously mentioned, phpunit 4.x requires sebastian/version ^1.

Unfortunately, in Drupal projects these tools can't be used.

As a solution I wonder if you were able to change the version requirement here in sebastian/phpcpd for sebastian/version to ^1 | ^2. That would allow all projects that still require phpunit <5 to also use a lot of other packages that also utilize your amazing tools.

@sebastianbergmann
Copy link
Owner

You can always use phpcpd (and other tools) from a PHP archive.

@jurgenhaas
Copy link
Author

Sure, but within a composer based workflow with a component that requires version 2 and another one requiring version 1 you're kind of stuck, aren't you?

@sebastianbergmann
Copy link
Owner

That is one of the reasons why I do not think that using Composer to manage tools is a good practice. Anyway, that is probably beside the point of this issue.

@jurgenhaas
Copy link
Author

There might be issues but also benefits, i.e. having qa tools per project and shared with the team of developers. You're right, that discussion is not for here though.

Any chance you would consider the change of required versions for sebastion/version? I mean, it wouldn't change anything for existing installations as they would stay with version 2 anyways.

zdenekdrahos added a commit to EdgedesignCZ/phpqa that referenced this issue Feb 3, 2018
https://travis-ci.org/EdgedesignCZ/phpqa/jobs/336877235

Don't use assertEquals
PHP Fatal error:  Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /vendor/sebastian/comparator/src/DOMNodeComparator.php on line 110

Updating phpunit sucks because of internal libraries used in phpcpd/phploc
sebastianbergmann/phpcpd#152
composer remove phpunit/phpunit --dev
composer require phpunit/phpunit:~5.7 --dev

    - Conclusion: remove phpunit/php-timer 2.0.0
    - Installation request for phpunit/phpunit ~5.7 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.22, 5.7.23, 5.7.24, 5.7.25, 5.7.26, 5.7.27, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].
    - Conclusion: don't install phpunit/php-timer 2.0.0
    - phpunit/phpunit 5.7.0 requires phpunit/php-timer ^1.0.6 -> satisfiable by phpunit/php-timer[1.0.6, 1.0.7, 1.0.8, 1.0.9].
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants