File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Inpsyde/Sniffs/CodeQuality Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Not released
4+ - Fix bug in ` NoAccessorsSniff `
5+
36## 0.7.2
47- Fix bug in ` ReturnTypeDeclarationSniff ` which caused wrong return type detection.
58
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public function process(File $file, $position)
5454 return ;
5555 }
5656
57- preg_match ('/^(set|get)[a-zA- Z0-9_\x7f-\xff ]+/ ' , $ functionName , $ matches );
57+ preg_match ('/^(set|get)[_A- Z0-9 ]+/ ' , $ functionName , $ matches );
5858 if (!$ matches ) {
5959 return ;
6060 }
@@ -67,6 +67,8 @@ public function process(File $file, $position)
6767 $ position ,
6868 'NoSetter '
6969 );
70+
71+ return ;
7072 }
7173
7274 $ file ->addWarning (
Original file line number Diff line number Diff line change 22
33// @phpcsSniff CodeQuality.NoAccessors
44
5+ function getting () {
6+
7+ }
8+
9+ function setting () {
10+
11+ }
12+
513interface WithAccessorsInterface {
614
715 // @phpcsWarningCodeOnNextLine NoGetter
816 function getTheThing ();
917
1018 // @phpcsWarningCodeOnNextLine NoSetter
1119 function setTheThing ($ foo , $ bar );
20+
21+ function setting ();
1222}
1323
1424class WithAccessors {
@@ -17,6 +27,10 @@ function thing() {
1727
1828 }
1929
30+ function setting () {
31+
32+ }
33+
2034 // @phpcsWarningCodeOnNextLine NoGetter
2135 function getTheThing () {
2236
You can’t perform that action at this time.
0 commit comments