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

No violations found #131

Open
placid2000 opened this issue Jul 1, 2017 · 8 comments
Open

No violations found #131

placid2000 opened this issue Jul 1, 2017 · 8 comments

Comments

@placid2000
Copy link

placid2000 commented Jul 1, 2017

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 ?

@slde-robin
Copy link
Contributor

Can you run it in verbose mode ?

@placid2000
Copy link
Author

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');

@achasseux
Copy link

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

@MarvinKlemp
Copy link
Contributor

MarvinKlemp commented Dec 4, 2017

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

@achasseux
Copy link

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.

@Voltash
Copy link

Voltash commented Dec 12, 2017

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

@MarvinKlemp
Copy link
Contributor

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

@achasseux
Copy link

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

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

5 participants