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()
4141 */
4242 public function process (File $ file , $ position )
4343 {
44- if (Helpers::isHookClosure ($ file , $ position ) || Helpers::isHookFunction ($ file , $ position )) {
45- return ;
46- }
47-
4844 list ($ functionStart , $ functionEnd ) = Helpers::functionBoundaries ($ file , $ position );
4945 if (!$ functionStart < 0 || $ functionEnd <= 0 ) {
5046 return ;
@@ -100,17 +96,21 @@ private function maybeErrors(
10096 return ;
10197 }
10298
103- if ($ hasNoReturnType ) {
104- $ file ->addWarning ('Return type is missing ' , $ position , 'NoReturnType ' );
105- }
106-
10799 if ($ hasVoidReturnType ) {
108100 $ file ->addError (
109101 'Void return type when returning non-void ' ,
110102 $ position ,
111103 'IncorrectVoidReturnType '
112104 );
113105 }
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+ }
114114 }
115115
116116 /**
You can’t perform that action at this time.
0 commit comments