Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of nikic/php-parser dependency #345

Closed
tarlepp opened this issue Apr 24, 2018 · 10 comments
Closed

Update of nikic/php-parser dependency #345

tarlepp opened this issue Apr 24, 2018 · 10 comments

Comments

@tarlepp
Copy link

tarlepp commented Apr 24, 2018

Any upgrade plans of this dependency?

Seems like next versions eg. psalm is using 4.x branch of that library, so basically I need to decide which one I'm going to keep.

Another solution would be phpmetrics-shim , which would only contain necessary .phar file

What do you think?

@tarlepp
Copy link
Author

tarlepp commented May 4, 2018

Any updates with this? Noticed that you cannot install this eg. for new symfony project (installed with composer create-project symfony/website-skeleton my-project command) because of this dependency:

under@code-2017-VirtualBox:~/PhpstormProjects/my-project$ composer require --dev phpmetrics/phpmetrics
Using version ^2.3 for phpmetrics/phpmetrics
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install phpmetrics/phpmetrics v2.3.2
    - Conclusion: don't install phpmetrics/phpmetrics v2.3.1
    - Conclusion: remove nikic/php-parser v4.0.1
    - Installation request for phpmetrics/phpmetrics ^2.3 -> satisfiable by phpmetrics/phpmetrics[v2.3.0, v2.3.1, v2.3.2].
    - Conclusion: don't install nikic/php-parser v4.0.1
    - phpmetrics/phpmetrics v2.3.0 requires nikic/php-parser v3.* -> satisfiable by nikic/php-parser[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5].
    - Can only install one of: nikic/php-parser[v3.0.0, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.1, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.2, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.3, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.4, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.5, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.0.6, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.0, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.1, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.2, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.3, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.4, v4.0.1].
    - Can only install one of: nikic/php-parser[v3.1.5, v4.0.1].
    - Installation request for nikic/php-parser (locked at v4.0.1) -> satisfiable by nikic/php-parser[v4.0.1].


Installation failed, reverting ./composer.json to its original content.
wunder@code-2017-VirtualBox:~/PhpstormProjects/my-project$ 

@UFOMelkor
Copy link
Member

Sorry for the inconvenience, will try to get through the PRs on Monday.

@RinkAttendant6
Copy link

@UFOMelkor @tarlepp Any update on this issue?

@tarlepp
Copy link
Author

tarlepp commented May 28, 2018

@RinkAttendant6
Copy link

@tarlepp I believe you were asked to test #347 which resolves the issue, are you able to get a chance to do that?

@auroraeosrose
Copy link

This is now starting to break a lot of installs of other libraries

Thanks UFOMelkor for the working PR - for those of you who just want to have a phpmetrics version that works with parser ^4 you need to add this to your composer.json

 "repositories": {
      "phpmetrics": {
          "type": "vcs",
          "url": "https://github.com/UFOMelkor/PhpMetrics"
        }
      }

or just add the repositories section

"require": {
"phpmetrics/phpmetrics": "dev-feature/345-php-parser-4 as 2.3.2",
}

or add in your require section

This aliases the working PR branch as a 2.3.2 release - a bit dirty but it works until this issue is fixed

@SmoshySmosh
Copy link

+1 - This is breaking my installs.

@juliangut
Copy link

Can't update other libraries such as phpstan because of this

@tarlepp
Copy link
Author

tarlepp commented Jun 26, 2018

I solved this with Composer bin plugin

@juliangut
Copy link

juliangut commented Jun 26, 2018

It looks awesome @tarlepp I'll try it ASAP

Update: A tutorial from @theofidry
https://medium.com/@tfidry/managing-your-dependencies-in-php-321d584441ab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants