File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
src/Exercism/Sniffs/StrictTypes Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " exercism/php" ,
33 "autoload" : {
4- "Exercism\\ " : " src" ,
4+ "Exercism\\ Sniffs \\ " : " src/Exercism/Sniffs " ,
55 "Exercism\\ Exercises\\ " : " exercises"
66 },
77 "config" : {
1313 "php" : " ^8.1" ,
1414 "phpunit/phpunit" : " ^10.5" ,
1515 "slevomat/coding-standard" : " ^8.14.1" ,
16- "squizlabs/php_codesniffer" : " ^3.9 "
16+ "squizlabs/php_codesniffer" : " ^3.11.1 "
1717 },
1818 "scripts" : {
1919 "post-install-cmd" : [
Original file line number Diff line number Diff line change 3434 <exclude-pattern >*/concept/city-office/*</exclude-pattern >
3535 <exclude-pattern >*/concept/windowing-system/*</exclude-pattern >
3636 </rule >
37- <rule ref =" vendor/slevomat/coding-standard/ SlevomatCodingStandard/Sniffs/ TypeHints/DeclareStrictTypesSniff.php " >
37+ <rule ref =" SlevomatCodingStandard. TypeHints.DeclareStrictTypes " >
3838 <exclude-pattern >*/.meta/*\.php</exclude-pattern >
3939 <exclude-pattern >*/concept/*</exclude-pattern >
4040 <exclude-pattern >*/hello-world/*</exclude-pattern >
4444 <property name =" spacesCountAroundEqualsSign" value =" 0" />
4545 </properties >
4646 </rule >
47- <rule ref =" src/Sniffs/ExplainStrictTypesSniff.php" >
47+ <rule ref =" src/Exercism/ Sniffs/StrictTypes /ExplainStrictTypesSniff.php" >
4848 <exclude-pattern >*/*Test\.php</exclude-pattern >
4949 <exclude-pattern >*/.meta/*\.php</exclude-pattern >
5050 <exclude-pattern >src/*</exclude-pattern >
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Exercism \Sniffs ;
5+ namespace Exercism \Sniffs \ StrictTypes ;
66
77use PHP_CodeSniffer \Files \File ;
88use PHP_CodeSniffer \Fixer ;
@@ -48,16 +48,16 @@ public function register(): array
4848 ];
4949 }
5050
51- public function process (File $ file , $ stackPtr )
51+ public function process (File $ phpcsFile , $ stackPtr ): void
5252 {
53- $ this ->fixer = $ file ->fixer ;
53+ $ this ->fixer = $ phpcsFile ->fixer ;
5454 $ this ->position = $ stackPtr ;
5555
56- if (!$ file ->findPrevious ($ this ->tokens , $ stackPtr )) {
57- $ file ->addFixableError (
56+ if (!$ phpcsFile ->findPrevious ($ this ->tokens , $ stackPtr )) {
57+ $ phpcsFile ->addFixableError (
5858 'Missing explanation of declaration of strict types. ' ,
5959 $ stackPtr - 1 ,
60- self ::class
60+ ' Missing '
6161 );
6262 $ this ->fix ();
6363 }
You can’t perform that action at this time.
0 commit comments