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 1
1
# Changelog
2
2
3
+ ## Not released
4
+ - Fix bug in ` NoAccessorsSniff `
5
+
3
6
## 0.7.2
4
7
- Fix bug in ` ReturnTypeDeclarationSniff ` which caused wrong return type detection.
5
8
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public function process(File $file, $position)
54
54
return ;
55
55
}
56
56
57
- preg_match ('/^(set|get)[a-zA- Z0-9_\x7f-\xff ]+/ ' , $ functionName , $ matches );
57
+ preg_match ('/^(set|get)[_A- Z0-9 ]+/ ' , $ functionName , $ matches );
58
58
if (!$ matches ) {
59
59
return ;
60
60
}
@@ -67,6 +67,8 @@ public function process(File $file, $position)
67
67
$ position ,
68
68
'NoSetter '
69
69
);
70
+
71
+ return ;
70
72
}
71
73
72
74
$ file ->addWarning (
Original file line number Diff line number Diff line change 2
2
3
3
// @phpcsSniff CodeQuality.NoAccessors
4
4
5
+ function getting () {
6
+
7
+ }
8
+
9
+ function setting () {
10
+
11
+ }
12
+
5
13
interface WithAccessorsInterface {
6
14
7
15
// @phpcsWarningCodeOnNextLine NoGetter
8
16
function getTheThing ();
9
17
10
18
// @phpcsWarningCodeOnNextLine NoSetter
11
19
function setTheThing ($ foo , $ bar );
20
+
21
+ function setting ();
12
22
}
13
23
14
24
class WithAccessors {
@@ -17,6 +27,10 @@ function thing() {
17
27
18
28
}
19
29
30
+ function setting () {
31
+
32
+ }
33
+
20
34
// @phpcsWarningCodeOnNextLine NoGetter
21
35
function getTheThing () {
22
36
You can’t perform that action at this time.
0 commit comments