deprecation-detector icon indicating copy to clipboard operation
deprecation-detector copied to clipboard

No violations found

Open placid2000 opened this issue 7 years ago • 8 comments

I installed deprecation-detector on dev-master and I'm on Symfony 2.8

When I run sh bin/deprecation-detector check src/ vendor/ or sh bin/deprecation-detector check src/ .rules or sh bin/deprecation-detector check src/, it says

There are no violations - congratulations!

Even that there are a lot of deprecations! For some reason it doesn't find any.. Did I miss anything ?

placid2000 avatar Jul 01 '17 15:07 placid2000

Can you run it in verbose mode ?

slde-robin avatar Jul 05 '17 11:07 slde-robin

I run : ./bin/deprecation-detector check src/ --verbose

Result: Deprecation detection: 261/261Finished searching for deprecations.

Rendering output...

Finished rendering output.

There are no violations - congratulations! Checked 261 source files in 39.297 seconds, 94 MB memory used

Here is just one example of deprecation in the Entity folder it should have found since addViolationAt is deprecated: $context->addViolationAt('financingPlan', 'Kosten dürfen nicht leer sein');

placid2000 avatar Jul 05 '17 12:07 placid2000

I have the same behavior, this tool already returns There are no violations - congratulations!

achasseux avatar Dec 04 '17 14:12 achasseux

is the project open source ? So I can try to recreate the issue ?

MarvinKlemp avatar Dec 04 '17 15:12 MarvinKlemp

The issue comes from an incompatibility with phpdocumentor/reflection-docblock versions. In your composer.json, you have mentioned "phpdocumentor/reflection-docblock": "~2.0 || ~3.0 || ~4.0"

But in your Visitor into hasDeprecatedDocComment() or getDeprecatedDocComment(), you create the DocBlock in an old way : $docBlock = new DocBlock((string) $node->getDocComment());

The new way for last version of phpdocumentor/reflection-docblock should be like this : $docBlock = (DocBlockFactory::createInstance())->create((string) $node->getDocComment());

I have installed your detector with version 4.2 of reflection-docblock.

achasseux avatar Dec 04 '17 16:12 achasseux

I had the same problem with Symfony 2.8 I disabled cache and then the command started working correctly.

php deprecation-detector.phar check src/ vendor/ --no-cache

Also works if manually set cache dir

php deprecation-detector.phar check src/ vendor/ --cache-dir=app/cache

Voltash avatar Dec 12 '17 16:12 Voltash

@achasseux do you want to create a pr and fix it ?

MarvinKlemp avatar Dec 19 '17 10:12 MarvinKlemp

@MarvinKlemp I can work on this issue next week, not before I 'm OK to create a PR

achasseux avatar Dec 19 '17 13:12 achasseux