Skip to content

Commit bb0c056

Browse files
committed
Skip return type check fro hook callbacks
1 parent e201714 commit bb0c056

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Inpsyde/Sniffs/CodeQuality/ReturnTypeDeclarationSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ 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+
4448
list($functionStart, $functionEnd) = Helpers::functionBoundaries($file, $position);
4549
if (!$functionStart < 0 || $functionEnd <= 0) {
4650
return;

0 commit comments

Comments
 (0)