Skip to content

Remove unstable Annotation sniffs #60

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

Merged
merged 1 commit into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
install: composer install --no-interaction --prefer-source
script:
- vendor/bin/phpunit
318 changes: 0 additions & 318 deletions Magento/Sniffs/Annotation/AnnotationFormatValidator.php

This file was deleted.

124 changes: 0 additions & 124 deletions Magento/Sniffs/Annotation/ClassAnnotationStructureSniff.php

This file was deleted.

80 changes: 0 additions & 80 deletions Magento/Sniffs/Annotation/MethodAnnotationStructureSniff.php

This file was deleted.

587 changes: 0 additions & 587 deletions Magento/Sniffs/Annotation/MethodArgumentsSniff.php

This file was deleted.

4 changes: 3 additions & 1 deletion Magento/Sniffs/Classes/ObjectInstantiationSniff.php
Original file line number Diff line number Diff line change
@@ -16,10 +16,12 @@ class ObjectInstantiationSniff implements Sniff
/**
* String representation of warning.
*
* phpcs:disable Magento.Files.LineLength.MaxExceeded
*
* @var string
*/
// phpcs:ignore Magento.Files.LineLength.MaxExceeded
protected $warningMessage = 'Direct %s object instantiation is discouraged in Magento. Use dependency injection or factories instead.';
//phpcs:enable

/**
* Warning violation code.
3 changes: 2 additions & 1 deletion Magento/Sniffs/Exceptions/DirectThrowSniff.php
Original file line number Diff line number Diff line change
@@ -15,9 +15,10 @@ class DirectThrowSniff implements Sniff
{
/**
* String representation of warning.
* phpcs:disable Generic.Files.LineLength.TooLong
*/
// phpcs:ignore Generic.Files.LineLength.TooLong
protected $warningMessage = 'Direct throw of generic Exception is discouraged. Use context specific instead.';
//phpcs:enable

/**
* Warning violation code.
5 changes: 2 additions & 3 deletions Magento/Sniffs/NamingConvention/ReservedWordsSniff.php
Original file line number Diff line number Diff line change
@@ -15,9 +15,8 @@ class ReservedWordsSniff implements Sniff
{
/**
* The following words cannot be used to name a class, interface or trait,
* and they are also prohibited from being used in namespaces.
*
* @link http://php.net/manual/en/reserved.other-reserved-words.php
* and they are also prohibited from being used in namespaces
* http://php.net/manual/en/reserved.other-reserved-words.php
*
* @var string[]
*/
4 changes: 3 additions & 1 deletion Magento/Sniffs/PHP/DateTimeSniff.php
Original file line number Diff line number Diff line change
@@ -16,10 +16,12 @@ class DateTimeSniff implements Sniff
/**
* String representation of warning.
*
* phpcs:disable Magento.Files.LineLength.MaxExceeded
*
* @var string
*/
// phpcs:ignore Magento.Files.LineLength.MaxExceeded
protected $warningMessage = 'Overcomplicated Date/Time handling. Use \Magento\Framework\Stdlib\DateTime\TimezoneInterface instead.';
// phpcs:enable

/**
* Warning violation code.
4 changes: 3 additions & 1 deletion Magento/Sniffs/Security/LanguageConstructSniff.php
Original file line number Diff line number Diff line change
@@ -23,10 +23,12 @@ class LanguageConstructSniff implements Sniff
/**
* String representation of backtick error.
*
* phpcs:disable Magento.Files.LineLength.MaxExceeded
*
* @var string
*/
// phpcs:ignore Magento.Files.LineLength.MaxExceeded
protected $errorMessageBacktick = 'Incorrect usage of back quote string constant. Back quotes should be always inside strings.';
//phpcs:enable

/**
* Backtick violation code.
4 changes: 3 additions & 1 deletion Magento/Sniffs/Strings/ExecutableRegExSniff.php
Original file line number Diff line number Diff line change
@@ -17,10 +17,12 @@ class ExecutableRegExSniff implements Sniff
/**
* String representation of error.
*
* phpcs:disable Magento.Files.LineLength.MaxExceeded
*
* @var string
*/
// phpcs:ignore Magento.Files.LineLength.MaxExceeded
protected $errorMessage = "Possible executable regular expression in %s. Make sure that the pattern doesn't contain 'e' modifier";
//phpcs:enable

/**
* Error violation code.
31 changes: 0 additions & 31 deletions Magento/Tests/Annotation/ClassAnnotationStructureUnitTest.inc

This file was deleted.

33 changes: 0 additions & 33 deletions Magento/Tests/Annotation/ClassAnnotationStructureUnitTest.php

This file was deleted.

309 changes: 0 additions & 309 deletions Magento/Tests/Annotation/MethodAnnotationStructureUnitTest.inc

This file was deleted.

54 changes: 0 additions & 54 deletions Magento/Tests/Annotation/MethodAnnotationStructureUnitTest.php

This file was deleted.

13 changes: 10 additions & 3 deletions Magento/ruleset.xml
Original file line number Diff line number Diff line change
@@ -434,17 +434,24 @@
</rule>

<!-- Severity 5 warnings: PHPDoc formatting and commenting issues. -->
<rule ref="Magento.Annotation">
<rule ref="Squiz.Commenting.DocCommentAlignment">
<severity>5</severity>
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.DocCommentAlignment">
<rule ref="Squiz.Commenting.ClassComment">
<severity>5</severity>
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.ClassComment.TagNotAllowed">
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionCommentThrowTag">
<severity>5</severity>
<type>warning</type>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="70"/>
<property name="maxPercentage" value="80"/>
</properties>
<severity>5</severity>
<type>warning</type>