-
Notifications
You must be signed in to change notification settings - Fork 160
Implement rule from #105 #124
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
Implement rule from #105 #124
Conversation
4c9e12a
to
36960e4
Compare
@udovicic thanks for opening this PR! It's going to be an awesome improvement, however I have few comments to make it even better 🙂
class NotAnErrorHandler
{
}
/**
* Faulty Handler
*/
class FaultyHandler
{
}
/**
*
*/
class FaultyHandler
{
}
|
Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php
Outdated
Show resolved
Hide resolved
Hi @lenaorobei , I am fine with the rest, but regarding the point 1: Definition says that class should have a short description, but that is not a must. Furthermore, in devdocs and the original issue, it actually says:
Therefore, I think that parth should remain as is |
@udovicic good catch! 🙂 Let me confirm this question with architecture team. My only one concern is that if we will allow no description, nobody will add any description at all. @paliarush @melnikovi need your input here since you were working on requirements for annotation rules. |
Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php
Outdated
Show resolved
Hide resolved
@udovicic I raised my concerns regarding missing PHPDoc Blocks magento/architecture#222 but got confirmation that your approach is correct and this is expected behaviour. Sorry for the confusion. One more thing. I run your branch against Magento2
This code throws a warning, but it shouldn't. |
f6ac4d4
to
952f950
Compare
@lenaorobei Not sure how I missed that one, but it has been added as a test case and code has been updated to reflect that. Everything else should be in there now. I understand that removing description from those classes is not optimal solution, but may come as future refactoring or something, I didn't consider it to be part of the original issue I am trying to resolve here. |
Hm, that's odd, but now these examples raise warnings. /**
* @api
*/
interface WysiwygModifierInterface
{} /**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class GroupRepositoryTest extends \PHPUnit\Framework\TestCase
{} It might be related to the string token after the tag. |
Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php
Outdated
Show resolved
Hide resolved
Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc
Outdated
Show resolved
Hide resolved
Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc
Outdated
Show resolved
Hide resolved
952f950
to
3d3f491
Compare
3d3f491
to
a439463
Compare
@lenaorobei I have added the suggested changes and fixed the latest issue. Tag detection was all wrong previously, it should be fine now (I have also added the test cases for it). |
…coding-standard-332 [Imported] AC-1059: Move PHPCompatibility rules from Magento tests
Implementation of rule from #105
Additionally, to avoid duplicated code, I have refactored
ConstantsPHPDocFormattingSniff
to make it reusable.