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

Internal error when importing PackageVersions\Versions #5157

Closed
iluuu1994 opened this issue Jun 10, 2021 · 6 comments
Closed

Internal error when importing PackageVersions\Versions #5157

iluuu1994 opened this issue Jun 10, 2021 · 6 comments

Comments

@iluuu1994
Copy link
Contributor

iluuu1994 commented Jun 10, 2021

Bug report

PHPStan triggers an internal error when importing PackageVersions\Versions.

This happens since PHPStan 0.12.89.

Code snippet that reproduces the problem

The website won't let me share it because it errors but this example is enough to trigger it:

<?php

use PackageVersions\Versions;

PHP Fatal error: Cannot declare class _HumbugBox15516bb2b566\Composer\InstalledVersions, because the name is already in use in phar:///app/vendor/phpstan/phpstan/phpstan.phar/vendor/composer/InstalledVersions.php on line 23

Expected output

No error

Did PHPStan help you today? Did it make you happy in any way?

You already know that I love PHPStan ❤️

@mergeable
Copy link

mergeable bot commented Jun 10, 2021

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Strangely I can't reproduce it locally but I know what caused it, just reverted the commit: phpstan/phpstan-src@b902c38

The file InstalledVersions.php isn't supposed to be prefixed with PHP-Scoper. I thought it's already whitelisted in new versions of Box but looks like it isn't.

Please test phpstan/phpstan with this command: composer require --dev phpstan/phpstan:dev-master --prefer-dist and let me know if it really works :)

And thank you for your kind words! ❤️

@yann-eugone
Copy link

Hey @ondrejmirtes :)

Thank you for this library and your reactivity.

I went into the same problem few days ago (while bumping dependencies of a project I work on).
It was only happening in GitlabCI.

I tried to use the dev-master version, as you suggested, and it solved the problem !

So once again, thank you ❤️

@ondrejmirtes
Copy link
Member

Awesome, please switch again to a stable version once 0.12.90 is out :) (in a matter of days)

@iluuu1994
Copy link
Contributor Author

Worked for us too 🙂

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2021
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

3 participants