| @@ 1713-1717 (lines=5) @@ | ||
| 1710 | case T_OPEN_SQUARE_BRACKET: |
|
| 1711 | $squareOpeners[] = $i; |
|
| 1712 | ||
| 1713 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
|
| 1714 | echo str_repeat("\t", count($squareOpeners)); |
|
| 1715 | echo str_repeat("\t", count($curlyOpeners)); |
|
| 1716 | echo "=> Found square bracket opener at $i".PHP_EOL; |
|
| 1717 | } |
|
| 1718 | break; |
|
| 1719 | case T_OPEN_CURLY_BRACKET: |
|
| 1720 | if (isset($tokens[$i]['scope_closer']) === false) { |
|
| @@ 1723-1727 (lines=5) @@ | ||
| 1720 | if (isset($tokens[$i]['scope_closer']) === false) { |
|
| 1721 | $curlyOpeners[] = $i; |
|
| 1722 | ||
| 1723 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
|
| 1724 | echo str_repeat("\t", count($squareOpeners)); |
|
| 1725 | echo str_repeat("\t", count($curlyOpeners)); |
|
| 1726 | echo "=> Found curly bracket opener at $i".PHP_EOL; |
|
| 1727 | } |
|
| 1728 | } |
|
| 1729 | break; |
|
| 1730 | case T_CLOSE_SQUARE_BRACKET: |
|
| @@ 1738-1742 (lines=5) @@ | ||
| 1735 | $tokens[$opener]['bracket_opener'] = $opener; |
|
| 1736 | $tokens[$opener]['bracket_closer'] = $i; |
|
| 1737 | ||
| 1738 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
|
| 1739 | echo str_repeat("\t", count($squareOpeners)); |
|
| 1740 | echo str_repeat("\t", count($curlyOpeners)); |
|
| 1741 | echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL; |
|
| 1742 | } |
|
| 1743 | } |
|
| 1744 | break; |
|
| 1745 | case T_CLOSE_CURLY_BRACKET: |
|
| @@ 1755-1759 (lines=5) @@ | ||
| 1752 | $tokens[$opener]['bracket_opener'] = $opener; |
|
| 1753 | $tokens[$opener]['bracket_closer'] = $i; |
|
| 1754 | ||
| 1755 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
|
| 1756 | echo str_repeat("\t", count($squareOpeners)); |
|
| 1757 | echo str_repeat("\t", count($curlyOpeners)); |
|
| 1758 | echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL; |
|
| 1759 | } |
|
| 1760 | } |
|
| 1761 | break; |
|
| 1762 | default: |
|
| @@ 1084-1089 (lines=6) @@ | ||
| 1081 | $tokens[$closer]['code'] = T_CLOSE_OBJECT; |
|
| 1082 | $tokens[$closer]['type'] = 'T_CLOSE_OBJECT'; |
|
| 1083 | ||
| 1084 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
|
| 1085 | echo str_repeat("\t", count($classStack)); |
|
| 1086 | echo "\t* token $i converted from T_OPEN_CURLY_BRACKET to T_OBJECT *".PHP_EOL; |
|
| 1087 | echo str_repeat("\t", count($classStack)); |
|
| 1088 | echo "\t* token $closer converted from T_CLOSE_CURLY_BRACKET to T_CLOSE_OBJECT *".PHP_EOL; |
|
| 1089 | } |
|
| 1090 | ||
| 1091 | for ($x = ($i + 1); $x < $closer; $x++) { |
|
| 1092 | $tokens[$x]['conditions'][$i] = T_OBJECT; |
|