@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | $error, |
573 | 573 | $stackPtr, |
574 | 574 | $code, |
575 | - $data=array(), |
|
576 | - $severity=0, |
|
577 | - $fixable=false |
|
575 | + $data = array(), |
|
576 | + $severity = 0, |
|
577 | + $fixable = false |
|
578 | 578 | ) { |
579 | 579 | if ($stackPtr === null) { |
580 | 580 | $line = 1; |
@@ -606,9 +606,9 @@ discard block |
||
606 | 606 | $warning, |
607 | 607 | $stackPtr, |
608 | 608 | $code, |
609 | - $data=array(), |
|
610 | - $severity=0, |
|
611 | - $fixable=false |
|
609 | + $data = array(), |
|
610 | + $severity = 0, |
|
611 | + $fixable = false |
|
612 | 612 | ) { |
613 | 613 | if ($stackPtr === null) { |
614 | 614 | $line = 1; |
@@ -639,8 +639,8 @@ discard block |
||
639 | 639 | $error, |
640 | 640 | $line, |
641 | 641 | $code, |
642 | - $data=array(), |
|
643 | - $severity=0 |
|
642 | + $data = array(), |
|
643 | + $severity = 0 |
|
644 | 644 | ) { |
645 | 645 | return $this->addMessage(true, $error, $line, 1, $code, $data, $severity, false); |
646 | 646 | |
@@ -663,8 +663,8 @@ discard block |
||
663 | 663 | $warning, |
664 | 664 | $line, |
665 | 665 | $code, |
666 | - $data=array(), |
|
667 | - $severity=0 |
|
666 | + $data = array(), |
|
667 | + $severity = 0 |
|
668 | 668 | ) { |
669 | 669 | return $this->addMessage(false, $warning, $line, 1, $code, $data, $severity, false); |
670 | 670 | |
@@ -689,8 +689,8 @@ discard block |
||
689 | 689 | $error, |
690 | 690 | $stackPtr, |
691 | 691 | $code, |
692 | - $data=array(), |
|
693 | - $severity=0 |
|
692 | + $data = array(), |
|
693 | + $severity = 0 |
|
694 | 694 | ) { |
695 | 695 | $recorded = $this->addError($error, $stackPtr, $code, $data, $severity, true); |
696 | 696 | if ($recorded === true && $this->fixer->enabled === true) { |
@@ -720,8 +720,8 @@ discard block |
||
720 | 720 | $warning, |
721 | 721 | $stackPtr, |
722 | 722 | $code, |
723 | - $data=array(), |
|
724 | - $severity=0 |
|
723 | + $data = array(), |
|
724 | + $severity = 0 |
|
725 | 725 | ) { |
726 | 726 | $recorded = $this->addWarning($warning, $stackPtr, $code, $data, $severity, true); |
727 | 727 | if ($recorded === true && $this->fixer->enabled === true) { |
@@ -1698,10 +1698,10 @@ discard block |
||
1698 | 1698 | public function findPrevious( |
1699 | 1699 | $types, |
1700 | 1700 | $start, |
1701 | - $end=null, |
|
1702 | - $exclude=false, |
|
1703 | - $value=null, |
|
1704 | - $local=false |
|
1701 | + $end = null, |
|
1702 | + $exclude = false, |
|
1703 | + $value = null, |
|
1704 | + $local = false |
|
1705 | 1705 | ) { |
1706 | 1706 | $types = (array) $types; |
1707 | 1707 | |
@@ -1779,10 +1779,10 @@ discard block |
||
1779 | 1779 | public function findNext( |
1780 | 1780 | $types, |
1781 | 1781 | $start, |
1782 | - $end=null, |
|
1783 | - $exclude=false, |
|
1784 | - $value=null, |
|
1785 | - $local=false |
|
1782 | + $end = null, |
|
1783 | + $exclude = false, |
|
1784 | + $value = null, |
|
1785 | + $local = false |
|
1786 | 1786 | ) { |
1787 | 1787 | $types = (array) $types; |
1788 | 1788 | |
@@ -1825,7 +1825,7 @@ discard block |
||
1825 | 1825 | * |
1826 | 1826 | * @return int |
1827 | 1827 | */ |
1828 | - public function findStartOfStatement($start, $ignore=null) |
|
1828 | + public function findStartOfStatement($start, $ignore = null) |
|
1829 | 1829 | { |
1830 | 1830 | $endTokens = Util\Tokens::$blockOpeners; |
1831 | 1831 | |
@@ -1890,7 +1890,7 @@ discard block |
||
1890 | 1890 | * |
1891 | 1891 | * @return int |
1892 | 1892 | */ |
1893 | - public function findEndOfStatement($start, $ignore=null) |
|
1893 | + public function findEndOfStatement($start, $ignore = null) |
|
1894 | 1894 | { |
1895 | 1895 | $endTokens = array( |
1896 | 1896 | T_COLON => true, |
@@ -1974,7 +1974,7 @@ discard block |
||
1974 | 1974 | * |
1975 | 1975 | * @return int | bool |
1976 | 1976 | */ |
1977 | - public function findFirstOnLine($types, $start, $exclude=false, $value=null) |
|
1977 | + public function findFirstOnLine($types, $start, $exclude = false, $value = null) |
|
1978 | 1978 | { |
1979 | 1979 | if (is_array($types) === false) { |
1980 | 1980 | $types = array($types); |
@@ -106,7 +106,7 @@ |
||
106 | 106 | * |
107 | 107 | * @return void |
108 | 108 | */ |
109 | - public function addFile($path, $file=null) |
|
109 | + public function addFile($path, $file = null) |
|
110 | 110 | { |
111 | 111 | // No filtering is done for STDIN. |
112 | 112 | if ($path === 'STDIN' |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @return string[] |
262 | 262 | * @throws RuntimeException If the ruleset path is invalid. |
263 | 263 | */ |
264 | - public function processRuleset($rulesetPath, $depth=0) |
|
264 | + public function processRuleset($rulesetPath, $depth = 0) |
|
265 | 265 | { |
266 | 266 | $rulesetPath = Util\Common::realpath($rulesetPath); |
267 | 267 | if (PHP_CODESNIFFER_VERBOSITY > 1) { |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | * |
507 | 507 | * @return array |
508 | 508 | */ |
509 | - private function expandSniffDirectory($directory, $depth=0) |
|
509 | + private function expandSniffDirectory($directory, $depth = 0) |
|
510 | 510 | { |
511 | 511 | $sniffs = array(); |
512 | 512 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | * @return array |
570 | 570 | * @throws RuntimeException If the reference is invalid. |
571 | 571 | */ |
572 | - private function expandRulesetReference($ref, $rulesetDir, $depth=0) |
|
572 | + private function expandRulesetReference($ref, $rulesetDir, $depth = 0) |
|
573 | 573 | { |
574 | 574 | // Ignore internal sniffs codes as they are used to only |
575 | 575 | // hide and change internal messages. |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | * @return void |
752 | 752 | * @throws RuntimeException If rule settings are invalid. |
753 | 753 | */ |
754 | - private function processRule($rule, $newSniffs, $depth=0) |
|
754 | + private function processRule($rule, $newSniffs, $depth = 0) |
|
755 | 755 | { |
756 | 756 | $ref = (string) $rule['ref']; |
757 | 757 | $todo = array($ref); |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | foreach (explode(',', $value) as $val) { |
862 | 862 | $v = ''; |
863 | 863 | |
864 | - list($k,$v) = explode('=>', $val.'=>'); |
|
864 | + list($k, $v) = explode('=>', $val.'=>'); |
|
865 | 865 | if ($v !== '') { |
866 | 866 | $values[$k] = $v; |
867 | 867 | } else { |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | * |
1167 | 1167 | * @return array |
1168 | 1168 | */ |
1169 | - public function getIgnorePatterns($listener=null) |
|
1169 | + public function getIgnorePatterns($listener = null) |
|
1170 | 1170 | { |
1171 | 1171 | if ($listener === null) { |
1172 | 1172 | return $this->ignorePatterns; |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | * |
1193 | 1193 | * @return array |
1194 | 1194 | */ |
1195 | - public function getIncludePatterns($listener=null) |
|
1195 | + public function getIncludePatterns($listener = null) |
|
1196 | 1196 | { |
1197 | 1197 | if ($listener === null) { |
1198 | 1198 | return $this->includePatterns; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | * |
49 | 49 | * @return void |
50 | 50 | */ |
51 | - public static function printRunTime($force=false) |
|
51 | + public static function printRunTime($force = false) |
|
52 | 52 | { |
53 | 53 | if ($force === false && self::$printed === true) { |
54 | 54 | // A double call. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $di = new \RecursiveDirectoryIterator($installDir); |
105 | 105 | $filter = new \RecursiveCallbackFilterIterator( |
106 | 106 | $di, |
107 | - function ($file, $key, $iterator) { |
|
107 | + function($file, $key, $iterator) { |
|
108 | 108 | // Skip hidden files. |
109 | 109 | $filename = $file->getFilename(); |
110 | 110 | if (substr($filename, 0, 1) === '.') { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * |
277 | 277 | * @return mixed |
278 | 278 | */ |
279 | - public static function get($key=null) |
|
279 | + public static function get($key = null) |
|
280 | 280 | { |
281 | 281 | if ($key === null) { |
282 | 282 | return self::$cache; |
@@ -60,8 +60,8 @@ |
||
60 | 60 | * @see isInstalledStandard() |
61 | 61 | */ |
62 | 62 | public static function getInstalledStandards( |
63 | - $includeGeneric=false, |
|
64 | - $standardsDir='' |
|
63 | + $includeGeneric = false, |
|
64 | + $standardsDir = '' |
|
65 | 65 | ) { |
66 | 66 | $installedStandards = array(); |
67 | 67 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @return string |
164 | 164 | */ |
165 | - public static function prepareForOutput($content, $exclude=array()) |
|
165 | + public static function prepareForOutput($content, $exclude = array()) |
|
166 | 166 | { |
167 | 167 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
168 | 168 | if (in_array("\r", $exclude) === false) { |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public static function isCamelCaps( |
223 | 223 | $string, |
224 | - $classFormat=false, |
|
225 | - $public=true, |
|
226 | - $strict=true |
|
224 | + $classFormat = false, |
|
225 | + $public = true, |
|
226 | + $strict = true |
|
227 | 227 | ) { |
228 | 228 | // Check the first character first. |
229 | 229 | if ($classFormat === false) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @return string |
239 | 239 | */ |
240 | - public function generateDiff($filePath=null, $colors=true) |
|
240 | + public function generateDiff($filePath = null, $colors = true) |
|
241 | 241 | { |
242 | 242 | if ($filePath === null) { |
243 | 243 | $filePath = $this->_currentFile->getFilename(); |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * |
655 | 655 | * @return bool If the change was accepted. |
656 | 656 | */ |
657 | - public function substrToken($stackPtr, $start, $length=null) |
|
657 | + public function substrToken($stackPtr, $start, $length = null) |
|
658 | 658 | { |
659 | 659 | $current = $this->getTokenContent($stackPtr); |
660 | 660 |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * |
278 | 278 | * @return void |
279 | 279 | */ |
280 | - public function __construct(array $cliArgs=array(), $dieOnUnknownArg=true) |
|
280 | + public function __construct(array $cliArgs = array(), $dieOnUnknownArg = true) |
|
281 | 281 | { |
282 | 282 | if (defined('PHP_CODESNIFFER_IN_TESTS') === true) { |
283 | 283 | // Let everything through during testing so that we can |
@@ -1224,7 +1224,7 @@ discard block |
||
1224 | 1224 | * @see getConfigData() |
1225 | 1225 | * @throws RuntimeException If the config file can not be written. |
1226 | 1226 | */ |
1227 | - public static function setConfigData($key, $value, $temp=false) |
|
1227 | + public static function setConfigData($key, $value, $temp = false) |
|
1228 | 1228 | { |
1229 | 1229 | if ($temp === false) { |
1230 | 1230 | $configFile = dirname(__FILE__).'/../CodeSniffer.conf'; |