Skip to content

Commit 8059803

Browse files
committed
Remove abstract rule
1 parent 53e3a4b commit 8059803

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ In Sniff/Commenting/FunctionCommentSniff:
6161
- don't check docblocks for test and setUp methods (PHPunit, would be blank)
6262
- do check protected and private methods for docblocks
6363

64+
In Sniff/NamingConventions/ValidClassNameSniff
65+
- remove the abstract class name rule
66+
6467
In ruleset.xml
6568
- Disabled the class comment rule
6669
- Changed the concatenation spacing rule, for readability, to require 1 space around concatenation dot, instead of no spaces as the [Symfony](https://symfony.com/doc/current/contributing/code/standards.html#structure) standard requires.

Symfony3Custom/Sniffs/NamingConventions/ValidClassNameSniff.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,6 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
125125
break;
126126
}
127127

128-
/*
129-
* Prefix abstract classes with Abstract.
130-
*/
131-
if ('T_ABSTRACT' == $tokens[$stackPtr]['type']) {
132-
$name = $phpcsFile->findNext(T_STRING, $stackPtr);
133-
$function = $phpcsFile->findNext(T_FUNCTION, $stackPtr);
134-
135-
// making sure we're not dealing with an abstract function
136-
if ($name && (is_null($function)
137-
|| $name < $function)
138-
&& substr($tokens[$name]['content'], 0, 8) != 'Abstract'
139-
) {
140-
$phpcsFile->addError(
141-
'Abstract class name is not prefixed with "Abstract"',
142-
$stackPtr,
143-
'InvalidAbstractName'
144-
);
145-
}
146-
break;
147-
}
148-
149128
$stackPtr++;
150129
}
151130

0 commit comments

Comments
 (0)