@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $data; |
140 | 140 | } |
141 | 141 | |
142 | - return false; |
|
142 | + return FALSE; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - return null; |
|
195 | + return NULL; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ]; |
59 | 59 | } |
60 | 60 | |
61 | - private function count(int $value = null) |
|
61 | + private function count(int $value = NULL) |
|
62 | 62 | { |
63 | 63 | return ((int)$value === 0) |
64 | 64 | ? '-' |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $endDate |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - public static function getAiringStatus(string $startDate = null, string $endDate = null): string |
|
73 | + public static function getAiringStatus(string $startDate = NULL, string $endDate = NULL): string |
|
74 | 74 | { |
75 | 75 | $startAirDate = new DateTimeImmutable($startDate ?? 'tomorrow'); |
76 | 76 | $endAirDate = new DateTimeImmutable($endDate ?? 'next year'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $isDoneAiring = $now > $endAirDate; |
80 | 80 | $isCurrentlyAiring = ($now > $startAirDate) && ! $isDoneAiring; |
81 | 81 | |
82 | - switch (true) |
|
82 | + switch (TRUE) |
|
83 | 83 | { |
84 | 84 | case $isCurrentlyAiring: |
85 | 85 | return AnimeAiringStatus::AIRING; |
@@ -98,28 +98,28 @@ discard block |
||
98 | 98 | * @param string $hostname |
99 | 99 | * @return array |
100 | 100 | */ |
101 | - protected static function getServiceMetaData(string $hostname = null): array |
|
101 | + protected static function getServiceMetaData(string $hostname = NULL): array |
|
102 | 102 | { |
103 | 103 | switch($hostname) |
104 | 104 | { |
105 | 105 | case 'www.crunchyroll.com': |
106 | 106 | return [ |
107 | 107 | 'name' => 'Crunchyroll', |
108 | - 'link' => true, |
|
108 | + 'link' => TRUE, |
|
109 | 109 | 'logo' => '<svg class="streaming-logo" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><g fill="#F78B24" fill-rule="evenodd"><path d="M22.549 49.145c-.815-.077-2.958-.456-3.753-.663-6.873-1.79-12.693-6.59-15.773-13.009C1.335 31.954.631 28.807.633 24.788c.003-4.025.718-7.235 2.38-10.686 1.243-2.584 2.674-4.609 4.706-6.66 3.8-3.834 8.614-6.208 14.067-6.936 1.783-.239 5.556-.161 7.221.148 3.463.642 6.571 1.904 9.357 3.797 5.788 3.934 9.542 9.951 10.52 16.861.21 1.48.332 4.559.19 4.816-.077.14-.117-.007-.167-.615-.25-3.015-1.528-6.66-3.292-9.388C40.253 7.836 30.249 4.32 20.987 7.467c-7.15 2.43-12.522 8.596-13.997 16.06-.73 3.692-.51 7.31.658 10.882a21.426 21.426 0 0 0 13.247 13.518c1.475.515 3.369.944 4.618 1.047 1.496.122 1.119.239-.727.224-1.006-.008-2.013-.032-2.237-.053z"></path><path d="M27.685 46.1c-7.731-.575-14.137-6.455-15.474-14.204-.243-1.41-.29-4.047-.095-5.345 1.16-7.706 6.97-13.552 14.552-14.639 1.537-.22 4.275-.143 5.746.162 1.28.266 2.7.737 3.814 1.266l.865.411-.814.392c-2.936 1.414-4.748 4.723-4.323 7.892.426 3.173 2.578 5.664 5.667 6.56 1.112.322 2.812.322 3.925 0 1.438-.417 2.566-1.1 3.593-2.173.346-.362.652-.621.68-.576.027.046.106.545.176 1.11.171 1.395.07 4.047-.204 5.371-.876 4.218-3.08 7.758-6.463 10.374-3.2 2.476-7.434 3.711-11.645 3.399z"></path></g></svg>' |
110 | 110 | ]; |
111 | 111 | |
112 | 112 | case 'www.funimation.com': |
113 | 113 | return [ |
114 | 114 | 'name' => 'Funimation', |
115 | - 'link' => true, |
|
115 | + 'link' => TRUE, |
|
116 | 116 | 'logo' => '<svg class="streaming-logo" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="M24.066.017a24.922 24.922 0 0 1 13.302 3.286 25.098 25.098 0 0 1 7.833 7.058 24.862 24.862 0 0 1 4.207 9.575c.82 4.001.641 8.201-.518 12.117a24.946 24.946 0 0 1-4.868 9.009 24.98 24.98 0 0 1-7.704 6.118 24.727 24.727 0 0 1-10.552 2.718A24.82 24.82 0 0 1 13.833 47.3c-5.815-2.872-10.408-8.107-12.49-14.25-2.162-6.257-1.698-13.375 1.303-19.28C5.483 8.07 10.594 3.55 16.602 1.435A24.94 24.94 0 0 1 24.066.017zm-8.415 33.31c.464 2.284 1.939 4.358 3.99 5.48 2.174 1.217 4.765 1.444 7.202 1.181 2.002-.217 3.986-.992 5.455-2.397 1.173-1.151 2.017-2.648 2.33-4.267-1.189-.027-2.378 0-3.566-.03-.568.082-1.137-.048-1.705.014-1.232.012-2.465.003-3.697-.01-.655.066-1.309-.035-1.963.013-1.166-.053-2.334.043-3.5-.025-1.515.08-3.03-.035-4.546.042z" fill="#411299" fill-rule="evenodd"></path></svg>' |
117 | 117 | ]; |
118 | 118 | |
119 | 119 | case 'www.hulu.com': |
120 | 120 | return [ |
121 | 121 | 'name' => 'Hulu', |
122 | - 'link' => true, |
|
122 | + 'link' => TRUE, |
|
123 | 123 | 'logo' => '<svg class="streaming-logo" viewBox="0 0 34 50" xmlns="http://www.w3.org/2000/svg"><path d="M22.222 13.889h-11.11V0H0v50h11.111V27.778c0-1.39 1.111-2.778 2.778-2.778h5.555c1.39 0 2.778 1.111 2.778 2.778V50h11.111V25c0-6.111-5-11.111-11.11-11.111z" fill="#8BC34A" fill-rule="evenodd"></path></svg>' |
124 | 124 | ]; |
125 | 125 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | default: |
129 | 129 | return [ |
130 | 130 | 'name' => 'Netflix', |
131 | - 'link' => false, |
|
131 | + 'link' => FALSE, |
|
132 | 132 | 'logo' => '<svg class="streaming-logo" viewBox="0 0 26 50" xmlns="http://www.w3.org/2000/svg"><path d="M.057.258C2.518.253 4.982.263 7.446.253c2.858 7.76 5.621 15.556 8.456 23.324.523 1.441 1.003 2.897 1.59 4.312.078-9.209.01-18.42.034-27.631h7.763v46.36c-2.812.372-5.637.627-8.457.957-1.203-3.451-2.396-6.902-3.613-10.348-1.796-5.145-3.557-10.302-5.402-15.428.129 8.954.015 17.912.057 26.871-2.603.39-5.227.637-7.815 1.119C.052 33.279.06 16.768.057.258z" fill="#E21221" fill-rule="evenodd"></path></svg>' |
133 | 133 | ]; |
134 | 134 | } |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | * @param array $existingTitles |
232 | 232 | * @return bool |
233 | 233 | */ |
234 | - private static function titleIsUnique(string $title = null, array $existingTitles): bool |
|
234 | + private static function titleIsUnique(string $title = NULL, array $existingTitles): bool |
|
235 | 235 | { |
236 | 236 | if (empty($title)) |
237 | 237 | { |
238 | - return false; |
|
238 | + return FALSE; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | foreach($existingTitles as $existing) |
@@ -246,10 +246,10 @@ discard block |
||
246 | 246 | |
247 | 247 | if ($diff < 3 || $isSubset || $onlydifferentCase) |
248 | 248 | { |
249 | - return false; |
|
249 | + return FALSE; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | - return true; |
|
253 | + return TRUE; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | \ No newline at end of file |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $this->taskPhpUnit() |
106 | 106 | ->configFile('build/phpunit.xml') |
107 | - ->printed(true) |
|
107 | + ->printed(TRUE) |
|
108 | 108 | ->run(); |
109 | 109 | } |
110 | 110 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $this->lint(); |
229 | 229 | $this->taskPHPUnit() |
230 | 230 | ->configFile('phpunit.xml') |
231 | - ->printed(true) |
|
231 | + ->printed(TRUE) |
|
232 | 232 | ->run(); |
233 | 233 | } |
234 | 234 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | // We are only interested if this is the first open tag. |
76 | 76 | if ($stackPtr !== 0) { |
77 | - if ($phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)) !== false) { |
|
77 | + if ($phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)) !== FALSE) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // removes the application root from the beginning of the file path |
85 | 85 | $locationPath = self::_getLocationPath($filePath, $this->_getAppRoot()); |
86 | 86 | // add an error, if application root doesn't exist in current file path |
87 | - if (false === $locationPath) { |
|
87 | + if (FALSE === $locationPath) { |
|
88 | 88 | $error = 'Unable to find "' . $this->_getAppRoot() . '" in file path "' . $filePath . '". Please set your project\'s application root.'; |
89 | 89 | $phpcsFile->addError($error, count($tokens) - 1); |
90 | 90 | return; |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | $commentTemplate = "Location: $locationPath"; |
94 | 94 | |
95 | 95 | $currentToken = count($tokens) - 1; |
96 | - $hasClosingLocationComment = false; |
|
97 | - $isNotAWhitespaceOrAComment = false; |
|
96 | + $hasClosingLocationComment = FALSE; |
|
97 | + $isNotAWhitespaceOrAComment = FALSE; |
|
98 | 98 | while ($currentToken >= 0 |
99 | 99 | && ! $isNotAWhitespaceOrAComment |
100 | 100 | && ! $hasClosingLocationComment |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | if (T_COMMENT === $tokenCode) { |
105 | 105 | $commentString = self::_getCommentContent($token['content']); |
106 | 106 | if (0 === strcmp($commentString, $commentTemplate)) { |
107 | - $hasClosingLocationComment = true; |
|
107 | + $hasClosingLocationComment = TRUE; |
|
108 | 108 | } |
109 | 109 | } else if (T_WHITESPACE === $tokenCode) { |
110 | 110 | // Whitespaces are allowed between the closing file comment, |
111 | 111 | //other comments and end of file |
112 | 112 | } else { |
113 | - $isNotAWhitespaceOrAComment = true; |
|
113 | + $isNotAWhitespaceOrAComment = TRUE; |
|
114 | 114 | } |
115 | 115 | $currentToken--; |
116 | 116 | } |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | // removes the path to application root |
143 | 143 | // from the beginning of the file path |
144 | 144 | $appRootAt = strpos($filePath, $appRoot); |
145 | - if (false === $appRootAt) { |
|
146 | - return false; |
|
145 | + if (FALSE === $appRootAt) { |
|
146 | + return FALSE; |
|
147 | 147 | } |
148 | 148 | $localPath = substr($filePath, $appRootAt + strlen($appRoot)); |
149 | 149 | // ensures the location path to be a relative path starting with "./". |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | private function _getAppRoot() |
173 | 173 | { |
174 | 174 | $appRoot = Common::getConfigData('ci_application_root'); |
175 | - if (null === $appRoot) { |
|
175 | + if (NULL === $appRoot) { |
|
176 | 176 | $appRoot = $this->applicationRoot; |
177 | 177 | } |
178 | 178 | return $appRoot; |
@@ -90,11 +90,11 @@ |
||
90 | 90 | */ |
91 | 91 | protected static function _stringStartsWith ($haystack, $needle) |
92 | 92 | { |
93 | - $startsWith = false; |
|
93 | + $startsWith = FALSE; |
|
94 | 94 | if (strlen($needle) <= strlen($haystack)) { |
95 | 95 | $haystackBeginning = substr($haystack, 0, strlen($needle)); |
96 | 96 | if (0 === strcmp($haystackBeginning, $needle)) { |
97 | - $startsWith = true; |
|
97 | + $startsWith = TRUE; |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | return $startsWith; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | // We are only interested if this is the first open tag. |
68 | 68 | if ($stackPtr !== 0) { |
69 | - if ($phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)) !== false) { |
|
69 | + if ($phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)) !== FALSE) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | |
78 | 78 | $tokens = $phpcsFile->getTokens(); |
79 | 79 | $currentToken = count($tokens) - 1; |
80 | - $hasClosingFileComment = false; |
|
81 | - $isNotAWhitespaceOrAComment = false; |
|
80 | + $hasClosingFileComment = FALSE; |
|
81 | + $isNotAWhitespaceOrAComment = FALSE; |
|
82 | 82 | while ($currentToken >= 0 |
83 | 83 | && ! $isNotAWhitespaceOrAComment |
84 | 84 | && ! $hasClosingFileComment |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | if (T_COMMENT === $tokenCode) { |
89 | 89 | $commentString = self::_getCommentContent($token['content']); |
90 | 90 | if (0 === strcmp($commentString, $commentTemplate)) { |
91 | - $hasClosingFileComment = true; |
|
91 | + $hasClosingFileComment = TRUE; |
|
92 | 92 | } |
93 | 93 | } else if (T_WHITESPACE === $tokenCode) { |
94 | 94 | // Whitespaces are allowed between the closing file comment, |
95 | 95 | // other comments and end of file |
96 | 96 | } else { |
97 | - $isNotAWhitespaceOrAComment = true; |
|
97 | + $isNotAWhitespaceOrAComment = TRUE; |
|
98 | 98 | } |
99 | 99 | $currentToken--; |
100 | 100 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function __construct() |
48 | 48 | { |
49 | - parent::__construct(array(T_CLASS, T_INTERFACE), array(T_FUNCTION), true); |
|
49 | + parent::__construct(array(T_CLASS, T_INTERFACE), array(T_FUNCTION), TRUE); |
|
50 | 50 | |
51 | 51 | }//end __construct() |
52 | 52 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | if ($this->php5Constructors != '0') { |
95 | 95 | $error = 'PHP4 style calls to parent constructors are not allowed.'; |
96 | 96 | $error = "$error Please use \"parent::__construct\" instead."; |
97 | - if (false !== $parentClassName) { |
|
97 | + if (FALSE !== $parentClassName) { |
|
98 | 98 | $wrongConstructor = $parentClassName; |
99 | 99 | } |
100 | 100 | // Else $wrongConstructor will be empty |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // when no parent class is defined. |
104 | 104 | } else { |
105 | 105 | $error = 'PHP5 style calls to parent constructors are not allowed.'; |
106 | - if (false !== $parentClassName) { |
|
106 | + if (FALSE !== $parentClassName) { |
|
107 | 107 | $error = "$error Please use \"parent::$parentClassName\" instead."; |
108 | 108 | } |
109 | 109 | $wrongConstructor = '__construct'; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $stringTk = $tokens[$stackPtr]; |
118 | 118 | $stringString = $stringTk['content']; |
119 | 119 | $varAt = self::_getVariablePosition($stringString, 0); |
120 | - while (false !== $varAt) { |
|
120 | + while (FALSE !== $varAt) { |
|
121 | 121 | // get variable name |
122 | 122 | $matches = array(); |
123 | 123 | preg_match('/^\$\{?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\}?/', substr($stringString, $varAt), $matches); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | protected function checkLowerCase(File $phpcsFile, $stackPtr, $varName) |
153 | 153 | { |
154 | - $isInLowerCase = true; |
|
154 | + $isInLowerCase = TRUE; |
|
155 | 155 | if (0 !== strcmp($varName, strtolower($varName))) { |
156 | 156 | // get the expected variable name |
157 | 157 | $varNameWithUnderscores = preg_replace('/([A-Z])/', '_${1}', $varName); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | . '" instead of "' . $varName . '".'; |
167 | 167 | // adds the error and changes return value |
168 | 168 | $phpcsFile->addError($error, $stackPtr); |
169 | - $isInLowerCase = false; |
|
169 | + $isInLowerCase = FALSE; |
|
170 | 170 | } |
171 | 171 | return $isInLowerCase; |
172 | 172 | }//end checkLowerCase() |
@@ -191,23 +191,23 @@ discard block |
||
191 | 191 | */ |
192 | 192 | protected function checkVisibilityPrefix(File $phpcsFile, $stackPtr, $varName, $varProps) |
193 | 193 | { |
194 | - $isVisibilityPrefixRight = true; |
|
194 | + $isVisibilityPrefixRight = TRUE; |
|
195 | 195 | $scope = $varProps['scope']; |
196 | 196 | // If it's a private variable, it must have an underscore on the front. |
197 | 197 | if ($scope === 'private' && $varName{0} !== '_') { |
198 | 198 | $error = "Private variable name \"$varName\" must be prefixed with an underscore"; |
199 | 199 | $phpcsFile->addError($error, $stackPtr); |
200 | - $isVisibilityPrefixRight = false; |
|
200 | + $isVisibilityPrefixRight = FALSE; |
|
201 | 201 | } else if ($scope !== 'private' && $varName{0} === '_') { |
202 | 202 | // If it's not a private variable, |
203 | 203 | // then it must not start with an underscore. |
204 | - if (isset ($scopeSpecified) && true === $scopeSpecified) { |
|
204 | + if (isset ($scopeSpecified) && TRUE === $scopeSpecified) { |
|
205 | 205 | $error = "Public variable name \"$varName\" must not be prefixed with an underscore"; |
206 | 206 | } else { |
207 | 207 | $error = ucfirst($scope) . " variable name \"$varName\" must not be prefixed with an underscore"; |
208 | 208 | } |
209 | 209 | $phpcsFile->addError($error, $stackPtr); |
210 | - $isVisibilityPrefixRight = false; |
|
210 | + $isVisibilityPrefixRight = FALSE; |
|
211 | 211 | } |
212 | 212 | return $isVisibilityPrefixRight; |
213 | 213 | }//end checkVisibilityPrefix() |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $minLength = 3; |
239 | 239 | $allowedShortName = array('ci'); |
240 | 240 | |
241 | - $isLengthRight = true; |
|
241 | + $isLengthRight = TRUE; |
|
242 | 242 | // cleans variable name |
243 | 243 | $varName = ltrim($varName, '_'); |
244 | 244 | if (strlen($varName) <= $minLength) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | return $isLengthRight; |
248 | 248 | } |
249 | 249 | // skips adding an error, if the variable is in a for loop |
250 | - if (false !== self::_isInForLoop($phpcsFile, $stackPtr, $varName)) { |
|
250 | + if (FALSE !== self::_isInForLoop($phpcsFile, $stackPtr, $varName)) { |
|
251 | 251 | return $isLengthRight; |
252 | 252 | } |
253 | 253 | // adds the error message finally |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | . ', non-word variables like "' . $varName |
261 | 261 | . '" should only be used as iterators in for() loops.'; |
262 | 262 | $phpcsFile->addError($error, $stackPtr); |
263 | - $isLengthRight = false; |
|
263 | + $isLengthRight = FALSE; |
|
264 | 264 | } |
265 | 265 | return $isLengthRight; |
266 | 266 | }//end checkLength() |
@@ -281,23 +281,23 @@ discard block |
||
281 | 281 | private static function _isInForLoop(File $phpcsFile, $stackPtr, $varName) |
282 | 282 | { |
283 | 283 | $keepLookingFromPtr = $stackPtr; |
284 | - while (false !== $keepLookingFromPtr) { |
|
284 | + while (FALSE !== $keepLookingFromPtr) { |
|
285 | 285 | // looks if it is in (head or body) of a for loop |
286 | 286 | $forPtr = self::_isInForLoopHead($phpcsFile, $keepLookingFromPtr); |
287 | - if (false === $forPtr) { |
|
287 | + if (FALSE === $forPtr) { |
|
288 | 288 | $forPtr = self::_isInForLoopBody($phpcsFile, $keepLookingFromPtr); |
289 | 289 | } |
290 | 290 | // checks if it is declared in here and prepares next step |
291 | - if (false !== $forPtr) { |
|
292 | - if (false !== self::_isDeclaredInForLoop($phpcsFile, $forPtr, $varName)) { |
|
291 | + if (FALSE !== $forPtr) { |
|
292 | + if (FALSE !== self::_isDeclaredInForLoop($phpcsFile, $forPtr, $varName)) { |
|
293 | 293 | return $forPtr; |
294 | 294 | } |
295 | 295 | $keepLookingFromPtr = $forPtr; |
296 | 296 | } else { |
297 | - $keepLookingFromPtr = false; |
|
297 | + $keepLookingFromPtr = FALSE; |
|
298 | 298 | } |
299 | 299 | } |
300 | - return false; |
|
300 | + return FALSE; |
|
301 | 301 | }//end _isInForLoop() |
302 | 302 | |
303 | 303 | /** |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | */ |
316 | 316 | private static function _isInForLoopHead(File $phpcsFile, $stackPtr) |
317 | 317 | { |
318 | - $isInForLoop = false; |
|
318 | + $isInForLoop = FALSE; |
|
319 | 319 | $tokens = $phpcsFile->getTokens(); |
320 | 320 | $currentTk = $tokens[$stackPtr]; |
321 | 321 | if (array_key_exists('nested_parenthesis', $currentTk)) { |
@@ -324,12 +324,12 @@ discard block |
||
324 | 324 | $nonWhitspacePtr = $phpcsFile->findPrevious( |
325 | 325 | array(T_WHITESPACE), |
326 | 326 | $openParPtr - 1, |
327 | - null, |
|
328 | - true, |
|
329 | - null, |
|
330 | - true |
|
327 | + NULL, |
|
328 | + TRUE, |
|
329 | + NULL, |
|
330 | + TRUE |
|
331 | 331 | ); |
332 | - if (false !== $nonWhitspacePtr) { |
|
332 | + if (FALSE !== $nonWhitspacePtr) { |
|
333 | 333 | $isFor = T_FOR === $tokens[$nonWhitspacePtr]['code']; |
334 | 334 | if ($isFor) { |
335 | 335 | $isInForLoop = $nonWhitspacePtr; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | private static function _isInForLoopBody(File $phpcsFile, $stackPtr) |
359 | 359 | { |
360 | - $isInForLoop = false; |
|
360 | + $isInForLoop = FALSE; |
|
361 | 361 | $tokens = $phpcsFile->getTokens(); |
362 | 362 | // get englobing hierarchy |
363 | 363 | $parentPtrAndCode = $tokens[$stackPtr]['conditions']; |
@@ -377,18 +377,18 @@ discard block |
||
377 | 377 | $openResearchScopePtr = $stackPtr; |
378 | 378 | // recursive search, since a for statement may englobe other inline |
379 | 379 | // control statement or may be near to function calls, etc... |
380 | - while (false !== $openResearchScopePtr) { |
|
380 | + while (FALSE !== $openResearchScopePtr) { |
|
381 | 381 | $closeParPtr = $phpcsFile->findPrevious( |
382 | 382 | array(T_CLOSE_PARENTHESIS), |
383 | 383 | $openResearchScopePtr, |
384 | - null, |
|
385 | - false, |
|
386 | - null, |
|
387 | - true |
|
384 | + NULL, |
|
385 | + FALSE, |
|
386 | + NULL, |
|
387 | + TRUE |
|
388 | 388 | ); |
389 | 389 | // is there a closing parenthesis with a control statement before |
390 | 390 | // the previous instruction ? |
391 | - if (false !== $closeParPtr) { |
|
391 | + if (FALSE !== $closeParPtr) { |
|
392 | 392 | // is there no opening curly bracket specific to |
393 | 393 | // set of instructions, between the closing parenthesis |
394 | 394 | // and the current token ? |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | } |
424 | 424 | } else { |
425 | - $openResearchScopePtr = false; |
|
425 | + $openResearchScopePtr = FALSE; |
|
426 | 426 | } |
427 | 427 | } |
428 | 428 | // looks for a for loop having a body enclosed with curly brackets |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | return $parentPtr; |
432 | 432 | } |
433 | 433 | } |
434 | - return false; |
|
434 | + return FALSE; |
|
435 | 435 | }//end _isInForLoopBody() |
436 | 436 | |
437 | 437 | /** |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | private static function _isDeclaredInForLoop(File $phpcsFile, $forPtr, $varName) |
451 | 451 | { |
452 | - $isDeclaredInFor = false; |
|
452 | + $isDeclaredInFor = FALSE; |
|
453 | 453 | $tokens = $phpcsFile->getTokens(); |
454 | 454 | $forVarPtrs = self::_getVarDeclaredInFor($phpcsFile, $forPtr); |
455 | 455 | foreach ($forVarPtrs as $forVarPtr) { |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | $openParPtr + 1, |
497 | 497 | $endOfDeclPtr |
498 | 498 | ); |
499 | - while (false !== $varPtr) { |
|
499 | + while (FALSE !== $varPtr) { |
|
500 | 500 | $forVarPtrs [] = $varPtr; |
501 | 501 | $varPtr = $phpcsFile->findNext( |
502 | 502 | array(T_VARIABLE), |
@@ -523,8 +523,8 @@ discard block |
||
523 | 523 | private static function _getVariablePosition($haystack, $offset = 0) |
524 | 524 | { |
525 | 525 | $var_starts_at = strpos($haystack, '$', $offset); |
526 | - $is_a_var = false; |
|
527 | - while (false !== $var_starts_at && ! $is_a_var) { |
|
526 | + $is_a_var = FALSE; |
|
527 | + while (FALSE !== $var_starts_at && ! $is_a_var) { |
|
528 | 528 | // makes sure that $ is used for a variable and not as a symbol, |
529 | 529 | // if $ is protected with the escape char, then it is a symbol. |
530 | 530 | if (0 !== strcmp($haystack[$var_starts_at - 1], '\\')) { |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | // so it looks for the closing brace in the right place |
534 | 534 | $hsChunk2 = substr($haystack, $var_starts_at + 2); |
535 | 535 | if (1 === preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\}/', $hsChunk2)) { |
536 | - $is_a_var = true; |
|
536 | + $is_a_var = TRUE; |
|
537 | 537 | } |
538 | 538 | } else { |
539 | 539 | $hsChunk1 = substr($haystack, $var_starts_at + 1); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | // $ is used for a variable and not as a symbol, |
542 | 542 | // since what follows $ matchs the definition of |
543 | 543 | // a variable label for PHP. |
544 | - $is_a_var = true; |
|
544 | + $is_a_var = TRUE; |
|
545 | 545 | } |
546 | 546 | } |
547 | 547 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | if ($is_a_var) { |
555 | 555 | return $var_starts_at; |
556 | 556 | } else { |
557 | - return false; |
|
557 | + return FALSE; |
|
558 | 558 | } |
559 | 559 | }//end _getVariablePosition() |
560 | 560 | }//end class |