File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Inpsyde/Sniffs/CodeQuality Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,6 @@ public function register()
41
41
*/
42
42
public function process (File $ file , $ position )
43
43
{
44
- if (Helpers::isHookClosure ($ file , $ position ) || Helpers::isHookFunction ($ file , $ position )) {
45
- return ;
46
- }
47
-
48
44
list ($ functionStart , $ functionEnd ) = Helpers::functionBoundaries ($ file , $ position );
49
45
if (!$ functionStart < 0 || $ functionEnd <= 0 ) {
50
46
return ;
@@ -100,17 +96,21 @@ private function maybeErrors(
100
96
return ;
101
97
}
102
98
103
- if ($ hasNoReturnType ) {
104
- $ file ->addWarning ('Return type is missing ' , $ position , 'NoReturnType ' );
105
- }
106
-
107
99
if ($ hasVoidReturnType ) {
108
100
$ file ->addError (
109
101
'Void return type when returning non-void ' ,
110
102
$ position ,
111
103
'IncorrectVoidReturnType '
112
104
);
113
105
}
106
+
107
+ if (Helpers::isHookClosure ($ file , $ position ) || Helpers::isHookFunction ($ file , $ position )) {
108
+ return ;
109
+ }
110
+
111
+ if ($ hasNoReturnType ) {
112
+ $ file ->addWarning ('Return type is missing ' , $ position , 'NoReturnType ' );
113
+ }
114
114
}
115
115
116
116
/**
You can’t perform that action at this time.
0 commit comments