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

Dependency conflict #144

Open
sanpii opened this issue May 14, 2018 · 1 comment
Open

Dependency conflict #144

sanpii opened this issue May 14, 2018 · 1 comment

Comments

@sanpii
Copy link

sanpii commented May 14, 2018

In a project requires nikic/php-parser in version 4.0, deprecation-detector throws an error due to incompatibilities between php-parser 3 and 4. I don’t understand why the phar uses local vendor instead of embeded.

Here minimals commands to reproduce the error:

composer --no-interaction require symfony/http-kernel nikic/php-parser
wget https://github.com/sensiolabs-de/deprecation-detector/releases/download/0.1.0-alpha4/deprecation-detector.phar
mkdir src
echo '<?php declare(strict_types = 1);

require __DIR__ . "/../vendor/autoload.php";

class Kernel extends Symfony\Component\HttpKernel\Kernel
{
    public function registerBundles()
    {
    }

    public function registerContainerConfiguration()
    {
    }
}

new Kernel('dev', true);' > src/app.php
php deprecation-detector.phar

And the error message, take attention to php file paths:

Checking your application for deprecations - this could take a while ...

Loading RuleSet...

RuleSet loaded.

Parsing files & Searching for deprecations...

PHP Fatal error:  Uncaught TypeError: Argument 3 passed to PhpParser\Node\Stmt\UseUse::__construct() must be of the type integer, array given, called in phar:///home/sanpi/tests/php/deprecation-detector.phar/vendor/nikic/php-parser/lib/PhpParser/Parser.php on line 1126 and defined in /home/sanpi/tests/php/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php:25
Stack trace:
#0 phar:///home/sanpi/tests/php/deprecation-detector.phar/vendor/nikic/php-parser/lib/PhpParser/Parser.php(1126): PhpParser\Node\Stmt\UseUse->__construct(Object(PhpParser\Node\Name), NULL, Array)                                                           
#1 phar:///home/sanpi/tests/php/deprecation-detector.phar/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(242): PhpParser\Parser->reduceRule20()                                                                                                     
#2 phar:///home/sanpi/tests/php/deprecation-detector.phar/src/Parser/UsageParser.php(69): PhpParser\ParserAbstract->parse('<?php\n\n/*\n * Th...')                                                                                                            
#3 phar:///home/sanpi/tests/php/deprecation-detector.phar/src/TypeGuessing/AncestorResolver.php(187): SensioLabs\DeprecationDetector\Parser\UsageParser->parseFile( in /home/sanpi/tests/php/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php on line 25
@TomasVotruba
Copy link

Shameless plug: you might like @rectorphp

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

2 participants