Passed
Pull Request — master (#153)
by
unknown
01:51
created
src/Codor/Sniffs/Classes/NewInstanceSniff.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Codor\Sniffs\Classes;
4 4
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function register(): array
15 15
     {
16
-        return [T_FUNCTION];
16
+        return [ T_FUNCTION ];
17 17
     }
18 18
 
19 19
     /**
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
     public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
28 28
     {
29 29
         $tokens = $phpcsFile->getTokens();
30
-        $functionName = $tokens[$stackPtr + 2]['content'];
31
-        $token = $tokens[$stackPtr];
30
+        $functionName = $tokens[ $stackPtr + 2 ][ 'content' ];
31
+        $token = $tokens[ $stackPtr ];
32 32
      
33
-        $start = $token['scope_opener'];
34
-        $end = $token['scope_closer'];
33
+        $start = $token[ 'scope_opener' ];
34
+        $end = $token[ 'scope_closer' ];
35 35
 
36 36
         foreach (range($start, $end) as $index) {
37
-            if ($tokens[$index]['type'] === 'T_NEW') {
38
-                $phpcsFile->addWarning($this->getWarningMessage($functionName), $tokens[$index]['line'], __CLASS__);
37
+            if ($tokens[ $index ][ 'type' ] === 'T_NEW') {
38
+                $phpcsFile->addWarning($this->getWarningMessage($functionName), $tokens[ $index ][ 'line' ], __CLASS__);
39 39
             }
40 40
         }
41 41
     }
Please login to merge, or discard this patch.