Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Feature - extended CS sniffs #109

Closed
wants to merge 3 commits into from
Closed

Feature - extended CS sniffs #109

wants to merge 3 commits into from

Conversation

michalbundyra
Copy link
Member

@michalbundyra
Copy link
Member Author

In this PR I've included some changes, probably it should be separate: classes ClassGenerator and TraitUsageGenerator now implements interface TraitUsageInterface. This interface has not been implemented anywhere but doc comments in these classes pointed to this interface. I think it is a bug in the library and it should be fixed in separate PR. I've did it here on purposes of this PR (for now it is just to show changes required by extended CS sniffs from zend-coding-standard library).

@Ocramius is there any other purpose of this not used interface, or I am right, and it should be used in these two classes?

@@ -11,33 +11,33 @@

use Zend\Code\Reflection\ClassReflection;

class ClassGenerator extends AbstractGenerator
class ClassGenerator extends AbstractGenerator implements TraitUsageInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhhh, unsure why this class should ever need TraitUsageInterface :-\

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ocramius Please check out my comment #109 (comment)
Please note that this class has all methods from this interface and in doc comments of these methods we had:
@inherit Zend\Code\Generator\TraitUsageInterface
what I've changed to @inheritDoc (but this is fine only when class has 'parent class' or 'interface' with these methods)

<exclude-pattern>src/Scanner/ClassScanner.php</exclude-pattern>
<exclude-pattern>src/Scanner/DocBlockScanner.php</exclude-pattern>
<exclude-pattern>src/Scanner/MethodScanner.php</exclude-pattern>
<exclude-pattern>src/Scanner/TokenArrayScanner.php</exclude-pattern>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these files we have variables like: $MACRO_STREAM_ADVANCE_CHAR. Probably we can rename all these variables there and then remove this exception here. Or is there any other reason why we have uppercase, underscore separated variable names there?

@Ocramius
Copy link
Member

I manually merged this patch to develop via 1dd0230, thanks @webimpress!

@Ocramius Ocramius closed this Jul 23, 2017
@michalbundyra michalbundyra deleted the feature/extended-sniffs branch October 5, 2019 23:31
@michalbundyra michalbundyra restored the feature/extended-sniffs branch October 5, 2019 23:31
@michalbundyra michalbundyra deleted the feature/extended-sniffs branch October 5, 2019 23:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants