coding-standard: UnusedUsesSniff and case mismatch

Hi,

I can see via https://github.com/slevomat/coding-standard/commit/7795645f18aebbff58ae1d0062ec6590642d0b3f there was a change to search for case-mismatch… however Im not sure if this is a behaviour change. In the example below its flagged because exception !== Exception however… this is a just a documentation comment about the class… Was this meant to target types in docblocks only?

Documentation like this tends to be written in non-programming syntax, whats the thought behind this change long term?


use Exception;
use Symfony\Component\HttpFoundation\Response;

/**
* An exception that encodes a fully-formed HTTP response.
*/
class ResponseException extends Exception

Another example, a simple documentation comment written in english.

/**
 * A custom Doctrine type for personal details in a checkout.
 */
class PersonalDetailsType extends Type

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 30 (15 by maintainers)

Most upvoted comments

I’m seeing a ton of these on my tests, too, now.

It seems like it should only be checking type-hinting annotations (@param, @return, @method, etc.) in the docblock.

It shouldn’t check all annotations: for example, Symfony @Route annotations should not be checked for class names.

Fucking sniff doing too much 😃

Yeah seems we all agree a general consensus, Id imagine this is a mistake and not expected behaviour

Just saw @Majkl578’s comment right now… I think it’s safe to assume that this issue has been fixed and move on to #280