@@ -105,8 +105,12 @@ |
||
| 105 | 105 | |
| 106 | 106 | }//end class |
| 107 | 107 | |
| 108 | -if ($index < -1) $index = 0; |
|
| 109 | -if ($index < - 1) $index = 0; |
|
| 108 | +if ($index < -1) { |
|
| 109 | + $index = 0; |
|
| 110 | +} |
|
| 111 | +if ($index < - 1) { |
|
| 112 | + $index = 0; |
|
| 113 | +} |
|
| 110 | 114 | |
| 111 | 115 | $three = ceil($one / $two); |
| 112 | 116 | $three = ceil(($one / $two) / $four); |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | function myFunction() |
| 54 | 54 | { |
| 55 | - $value = ($one + 1) + ($two + 2) + (myFunction() + 2); |
|
| 56 | - $value = myFunction() + 2; |
|
| 57 | - $value = (myFunction($var) + myFunction2($var)); |
|
| 58 | - return -1; |
|
| 55 | + $value = ($one + 1) + ($two + 2) + (myFunction() + 2); |
|
| 56 | + $value = myFunction() + 2; |
|
| 57 | + $value = (myFunction($var) + myFunction2($var)); |
|
| 58 | + return -1; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $line = substr($line, 0, -2); |
@@ -65,18 +65,18 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if ($pos === count($this->tokens) - 1) { |
| 68 | - $file = '...'.substr($file, (($padding * -1) + 3)); |
|
| 68 | + $file = '...'.substr($file, (($padding * -1) + 3)); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if (substr($basename, -5) !== 'Sniff') { |
| 72 | - $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); |
|
| 72 | + $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $pos = $this->_getShortCommentEndPos(); |
| 76 | 76 | if ($pos === -1) { |
| 77 | - $stackPtr = ($tokens[$next][$to] - 1); |
|
| 78 | - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); |
|
| 79 | - $var = (($var1 + $var2) + $var3 + $var4) |
|
| 77 | + $stackPtr = ($tokens[$next][$to] - 1); |
|
| 78 | + $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); |
|
| 79 | + $var = (($var1 + $var2) + $var3 + $var4) |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; |
| 85 | 85 | |
| 86 | 86 | if (($tokens[$nextToken - 1]['code']) !== T_WHITESPACE) { |
| 87 | - $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); |
|
| 87 | + $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, $nextSpace + 1, $nextBreak)) !== false) { |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | |
| 99 | 99 | |
| 100 | - public function &myFunction(array &$one, array &$two) |
|
| 101 | - { |
|
| 100 | + public function &myFunction(array &$one, array &$two) |
|
| 101 | + { |
|
| 102 | 102 | |
| 103 | - }//end myFunction() |
|
| 103 | + }//end myFunction() |
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | }//end class |
@@ -117,19 +117,19 @@ discard block |
||
| 117 | 117 | $three = ceil($one[1] / $two); |
| 118 | 118 | |
| 119 | 119 | switch ($number % 10) { |
| 120 | - case -1: |
|
| 121 | - $suffix = 'st'; |
|
| 122 | - break; |
|
| 120 | + case -1: |
|
| 121 | + $suffix = 'st'; |
|
| 122 | + break; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $expectedPermission = array( |
| 126 | - 'granted' => 4, |
|
| 127 | - 'denied' => 1, |
|
| 128 | - 'cascade' => TRUE, |
|
| 129 | - 'blockergranted' => 2, |
|
| 130 | - 'blockerdenied' => - 3, |
|
| 131 | - 'effective' => TRUE, |
|
| 132 | - ); |
|
| 126 | + 'granted' => 4, |
|
| 127 | + 'denied' => 1, |
|
| 128 | + 'cascade' => TRUE, |
|
| 129 | + 'blockergranted' => 2, |
|
| 130 | + 'blockerdenied' => - 3, |
|
| 131 | + 'effective' => TRUE, |
|
| 132 | + ); |
|
| 133 | 133 | |
| 134 | 134 | $value = (int) isset($blah) + 2; |
| 135 | 135 | $value = (int) isset($blah) + (int) isset($foo) + (int) isset($bar); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | foo(1 + 2 + 3); |
| 152 | 152 | |
| 153 | 153 | if (empty($foo[-1]) === true) { |
| 154 | - $foo[-1] = 'foo'; |
|
| 154 | + $foo[-1] = 'foo'; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | try { |
@@ -178,18 +178,18 @@ discard block |
||
| 178 | 178 | exit -1; |
| 179 | 179 | |
| 180 | 180 | $expr = match ($number - 10) { |
| 181 | - -1 => 0, |
|
| 181 | + -1 => 0, |
|
| 182 | 182 | }; |
| 183 | 183 | |
| 184 | 184 | $expr = match ($number % 10) { |
| 185 | - 1 => 2 * $num, |
|
| 185 | + 1 => 2 * $num, |
|
| 186 | 186 | }; |
| 187 | 187 | |
| 188 | 188 | $expr = match (true) { |
| 189 | - $num * 100 > 500 => 'expression in key', |
|
| 189 | + $num * 100 > 500 => 'expression in key', |
|
| 190 | 190 | }; |
| 191 | 191 | |
| 192 | 192 | // PHP 8.0 named parameters. |
| 193 | 193 | if ($pos === count(value: $this->tokens) - 1) { |
| 194 | - $file = '...'.substr(string: $file, offset: $padding * -1 + 3); |
|
| 194 | + $file = '...'.substr(string: $file, offset: $padding * -1 + 3); |
|
| 195 | 195 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $line = substr($line, 0, -2); |
| 62 | 62 | $words = preg_split('|(\s+)|', $line."\n", -1, $flags); |
| 63 | -if (!isset($this->words[$wordPos-1]) || $this->words[$wordPos-1] !== ' ') { |
|
| 63 | +if ( ! isset($this->words[$wordPos - 1]) || $this->words[$wordPos - 1] !== ' ') { |
|
| 64 | 64 | } else if ($this->tokens[$pos + 1] === "\n") { |
| 65 | 65 | } |
| 66 | 66 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | 'denied' => 1, |
| 128 | 128 | 'cascade' => TRUE, |
| 129 | 129 | 'blockergranted' => 2, |
| 130 | - 'blockerdenied' => - 3, |
|
| 130 | + 'blockerdenied' => -3, |
|
| 131 | 131 | 'effective' => TRUE, |
| 132 | 132 | ); |
| 133 | 133 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | $var = $foo['blah'] + []; |
| 162 | 162 | |
| 163 | -$a = 2 * ${x} - ${minus}; |
|
| 163 | +$a = 2 * ${x} -${minus}; |
|
| 164 | 164 | |
| 165 | 165 | $foo = $bar ?? $baz ?? ''; |
| 166 | 166 | |
@@ -15,52 +15,52 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 3 => 5, |
|
| 30 | - 5 => 1, |
|
| 31 | - 6 => 1, |
|
| 32 | - 9 => 1, |
|
| 33 | - 10 => 1, |
|
| 34 | - 12 => 1, |
|
| 35 | - 13 => 1, |
|
| 36 | - 14 => 1, |
|
| 37 | - 15 => 1, |
|
| 38 | - 16 => 5, |
|
| 39 | - 22 => 1, |
|
| 40 | - 27 => 5, |
|
| 41 | - 29 => 1, |
|
| 42 | - 30 => 1, |
|
| 43 | - 31 => 1, |
|
| 44 | - 47 => 2, |
|
| 45 | - 49 => 1, |
|
| 46 | - ]; |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 3 => 5, |
|
| 30 | + 5 => 1, |
|
| 31 | + 6 => 1, |
|
| 32 | + 9 => 1, |
|
| 33 | + 10 => 1, |
|
| 34 | + 12 => 1, |
|
| 35 | + 13 => 1, |
|
| 36 | + 14 => 1, |
|
| 37 | + 15 => 1, |
|
| 38 | + 16 => 5, |
|
| 39 | + 22 => 1, |
|
| 40 | + 27 => 5, |
|
| 41 | + 29 => 1, |
|
| 42 | + 30 => 1, |
|
| 43 | + 31 => 1, |
|
| 44 | + 47 => 2, |
|
| 45 | + 49 => 1, |
|
| 46 | + ]; |
|
| 47 | 47 | |
| 48 | - }//end getErrorList() |
|
| 48 | + }//end getErrorList() |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Returns the lines where warnings should occur. |
|
| 53 | - * |
|
| 54 | - * The key of the array should represent the line number and the value |
|
| 55 | - * should represent the number of warnings that should occur on that line. |
|
| 56 | - * |
|
| 57 | - * @return array<int, int> |
|
| 58 | - */ |
|
| 59 | - public function getWarningList() |
|
| 60 | - { |
|
| 61 | - return []; |
|
| 51 | + /** |
|
| 52 | + * Returns the lines where warnings should occur. |
|
| 53 | + * |
|
| 54 | + * The key of the array should represent the line number and the value |
|
| 55 | + * should represent the number of warnings that should occur on that line. |
|
| 56 | + * |
|
| 57 | + * @return array<int, int> |
|
| 58 | + */ |
|
| 59 | + public function getWarningList() |
|
| 60 | + { |
|
| 61 | + return []; |
|
| 62 | 62 | |
| 63 | - }//end getWarningList() |
|
| 63 | + }//end getWarningList() |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | }//end class |
@@ -33,5 +33,5 @@ |
||
| 33 | 33 | there"; |
| 34 | 34 | |
| 35 | 35 | function test() { |
| 36 | - echo "It Worked'; |
|
| 36 | + echo "It Worked'; |
|
| 37 | 37 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $string = "\$var"; |
| 18 | 18 | |
| 19 | 19 | $x = "bar = '$z', |
| 20 | -baz = '" . $a . "'...$x"; |
|
| 20 | +baz = '".$a."'...$x"; |
|
| 21 | 21 | |
| 22 | 22 | $string = "Hello |
| 23 | 23 | there"; |
@@ -15,48 +15,48 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 4 => 1, |
|
| 30 | - 5 => 1, |
|
| 31 | - 6 => 1, |
|
| 32 | - 8 => 2, |
|
| 33 | - 14 => 1, |
|
| 34 | - 15 => 1, |
|
| 35 | - 17 => 1, |
|
| 36 | - 19 => 1, |
|
| 37 | - 20 => 1, |
|
| 38 | - 22 => 1, |
|
| 39 | - 29 => 1, |
|
| 40 | - 30 => 1, |
|
| 41 | - 32 => 1, |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - }//end getErrorList() |
|
| 45 | - |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * Returns the lines where warnings should occur. |
|
| 49 | - * |
|
| 50 | - * The key of the array should represent the line number and the value |
|
| 51 | - * should represent the number of warnings that should occur on that line. |
|
| 52 | - * |
|
| 53 | - * @return array<int, int> |
|
| 54 | - */ |
|
| 55 | - public function getWarningList() |
|
| 56 | - { |
|
| 57 | - return []; |
|
| 58 | - |
|
| 59 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 4 => 1, |
|
| 30 | + 5 => 1, |
|
| 31 | + 6 => 1, |
|
| 32 | + 8 => 2, |
|
| 33 | + 14 => 1, |
|
| 34 | + 15 => 1, |
|
| 35 | + 17 => 1, |
|
| 36 | + 19 => 1, |
|
| 37 | + 20 => 1, |
|
| 38 | + 22 => 1, |
|
| 39 | + 29 => 1, |
|
| 40 | + 30 => 1, |
|
| 41 | + 32 => 1, |
|
| 42 | + ]; |
|
| 43 | + |
|
| 44 | + }//end getErrorList() |
|
| 45 | + |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * Returns the lines where warnings should occur. |
|
| 49 | + * |
|
| 50 | + * The key of the array should represent the line number and the value |
|
| 51 | + * should represent the number of warnings that should occur on that line. |
|
| 52 | + * |
|
| 53 | + * @return array<int, int> |
|
| 54 | + */ |
|
| 55 | + public function getWarningList() |
|
| 56 | + { |
|
| 57 | + return []; |
|
| 58 | + |
|
| 59 | + }//end getWarningList() |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | }//end class |
@@ -15,41 +15,41 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 5 => 1, |
|
| 30 | - 6 => 1, |
|
| 31 | - 7 => 1, |
|
| 32 | - 8 => 1, |
|
| 33 | - 9 => 1, |
|
| 34 | - 13 => 1, |
|
| 35 | - ]; |
|
| 36 | - |
|
| 37 | - }//end getErrorList() |
|
| 38 | - |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * Returns the lines where warnings should occur. |
|
| 42 | - * |
|
| 43 | - * The key of the array should represent the line number and the value |
|
| 44 | - * should represent the number of warnings that should occur on that line. |
|
| 45 | - * |
|
| 46 | - * @return array<int, int> |
|
| 47 | - */ |
|
| 48 | - public function getWarningList() |
|
| 49 | - { |
|
| 50 | - return []; |
|
| 51 | - |
|
| 52 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 5 => 1, |
|
| 30 | + 6 => 1, |
|
| 31 | + 7 => 1, |
|
| 32 | + 8 => 1, |
|
| 33 | + 9 => 1, |
|
| 34 | + 13 => 1, |
|
| 35 | + ]; |
|
| 36 | + |
|
| 37 | + }//end getErrorList() |
|
| 38 | + |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * Returns the lines where warnings should occur. |
|
| 42 | + * |
|
| 43 | + * The key of the array should represent the line number and the value |
|
| 44 | + * should represent the number of warnings that should occur on that line. |
|
| 45 | + * |
|
| 46 | + * @return array<int, int> |
|
| 47 | + */ |
|
| 48 | + public function getWarningList() |
|
| 49 | + { |
|
| 50 | + return []; |
|
| 51 | + |
|
| 52 | + }//end getWarningList() |
|
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | }//end class |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | echo($hello); |
| 7 | 7 | echo ('hello'); |
| 8 | 8 | echo ($hello); |
| 9 | -echo($y) ; |
|
| 9 | +echo($y); |
|
| 10 | 10 | echo ($loan_device->returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); |
| 11 | 11 | ?> |
| 12 | -<p><?php echo ($foo) ? 'true' : 'false' ?></p> |
|
| 12 | +<p><?php echo ($foo) ? 'true' : 'false' ?></p> |
|
| 13 | 13 | <p><?php echo ($foo) ?></p> |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | . '3'; |
| 37 | 37 | |
| 38 | 38 | $y = '1' . |
| 39 | - '2' . |
|
| 40 | - '3'; |
|
| 39 | + '2' . |
|
| 40 | + '3'; |
|
| 41 | 41 | |
| 42 | 42 | $y = '1' |
| 43 | 43 | . '2' |
@@ -45,5 +45,5 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $y = '1' |
| 47 | 47 | .'2'. |
| 48 | - '3' |
|
| 48 | + '3' |
|
| 49 | 49 | . '4'; |
@@ -1,42 +1,42 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $string = 'Hello'.$there.'. How are'.$you.$going."today $okay"; |
| 3 | -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; |
|
| 3 | +$string = 'Hello'.$there.'. How are'.$you.$going."today $okay"; |
|
| 4 | +$string = 'Hello'.$there; |
|
| 5 | +$string = 'Hello'.$there; |
|
| 4 | 6 | $string = 'Hello'.$there; |
| 5 | -$string = 'Hello'. $there; |
|
| 6 | -$string = 'Hello' .$there; |
|
| 7 | 7 | |
| 8 | 8 | $y = '1' |
| 9 | 9 | . '2' |
| 10 | 10 | . '3'; |
| 11 | 11 | |
| 12 | -echo 1 . 'test'; |
|
| 13 | -echo 1.1 . 'test'; |
|
| 14 | -echo 'test' . 1; |
|
| 15 | -echo 'test' . 1.1; |
|
| 16 | -echo 'test' . 1 . 'test' . 2.2 . 'test' . 3; |
|
| 12 | +echo 1.'test'; |
|
| 13 | +echo 1.1.'test'; |
|
| 14 | +echo 'test'.1; |
|
| 15 | +echo 'test'.1.1; |
|
| 16 | +echo 'test'.1.'test'.2.2.'test'.3; |
|
| 17 | 17 | |
| 18 | -get_current_screen()->add_help_tab( array( |
|
| 18 | +get_current_screen()->add_help_tab(array( |
|
| 19 | 19 | 'id' => <<<EOD |
| 20 | 20 | Here comes some text. |
| 21 | 21 | EOD |
| 22 | 22 | . '</hr>', |
| 23 | -) ); |
|
| 23 | +)); |
|
| 24 | 24 | |
| 25 | 25 | // phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 |
| 26 | 26 | |
| 27 | -$string = 'Hello'.$there.'. How are'.$you.$going. "today $okay"; |
|
| 28 | -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; |
|
| 27 | +$string = 'Hello'.$there.'. How are'.$you.$going."today $okay"; |
|
| 28 | +$string = 'Hello'.$there.'. How are'.$you.$going."today $okay"; |
|
| 29 | +$string = 'Hello'.$there; |
|
| 30 | +$string = 'Hello'.$there; |
|
| 29 | 31 | $string = 'Hello'.$there; |
| 30 | -$string = 'Hello'. $there; |
|
| 31 | -$string = 'Hello' .$there; |
|
| 32 | 32 | |
| 33 | 33 | // phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true |
| 34 | 34 | $y = '1' |
| 35 | 35 | . '2' |
| 36 | 36 | . '3'; |
| 37 | 37 | |
| 38 | -$y = '1' . |
|
| 39 | - '2' . |
|
| 38 | +$y = '1'. |
|
| 39 | + '2'. |
|
| 40 | 40 | '3'; |
| 41 | 41 | |
| 42 | 42 | $y = '1' |
@@ -15,41 +15,41 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @param string $testFile The name of the file being tested. |
|
| 25 | - * |
|
| 26 | - * @return array<int, int> |
|
| 27 | - */ |
|
| 28 | - public function getErrorList($testFile='') |
|
| 29 | - { |
|
| 30 | - switch ($testFile) { |
|
| 31 | - case 'FileExtensionUnitTest.1.inc': |
|
| 32 | - return [1 => 1]; |
|
| 33 | - default: |
|
| 34 | - return []; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - }//end getErrorList() |
|
| 38 | - |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * Returns the lines where warnings should occur. |
|
| 42 | - * |
|
| 43 | - * The key of the array should represent the line number and the value |
|
| 44 | - * should represent the number of warnings that should occur on that line. |
|
| 45 | - * |
|
| 46 | - * @return array<int, int> |
|
| 47 | - */ |
|
| 48 | - public function getWarningList() |
|
| 49 | - { |
|
| 50 | - return []; |
|
| 51 | - |
|
| 52 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @param string $testFile The name of the file being tested. |
|
| 25 | + * |
|
| 26 | + * @return array<int, int> |
|
| 27 | + */ |
|
| 28 | + public function getErrorList($testFile='') |
|
| 29 | + { |
|
| 30 | + switch ($testFile) { |
|
| 31 | + case 'FileExtensionUnitTest.1.inc': |
|
| 32 | + return [1 => 1]; |
|
| 33 | + default: |
|
| 34 | + return []; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + }//end getErrorList() |
|
| 38 | + |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * Returns the lines where warnings should occur. |
|
| 42 | + * |
|
| 43 | + * The key of the array should represent the line number and the value |
|
| 44 | + * should represent the number of warnings that should occur on that line. |
|
| 45 | + * |
|
| 46 | + * @return array<int, int> |
|
| 47 | + */ |
|
| 48 | + public function getWarningList() |
|
| 49 | + { |
|
| 50 | + return []; |
|
| 51 | + |
|
| 52 | + }//end getWarningList() |
|
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | }//end class |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | public function getErrorList($testFile='') |
| 29 | 29 | { |
| 30 | 30 | switch ($testFile) { |
| 31 | - case 'FileExtensionUnitTest.1.inc': |
|
| 32 | - return [1 => 1]; |
|
| 33 | - default: |
|
| 34 | - return []; |
|
| 31 | + case 'FileExtensionUnitTest.1.inc': |
|
| 32 | + return [1 => 1]; |
|
| 33 | + default: |
|
| 34 | + return []; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | }//end getErrorList() |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return array<int, int> |
| 27 | 27 | */ |
| 28 | - public function getErrorList($testFile='') |
|
| 28 | + public function getErrorList($testFile = '') |
|
| 29 | 29 | { |
| 30 | 30 | switch ($testFile) { |
| 31 | 31 | case 'FileExtensionUnitTest.1.inc': |
@@ -157,8 +157,8 @@ |
||
| 157 | 157 | |
| 158 | 158 | switch($foo) { |
| 159 | 159 | |
| 160 | - case 'bar': |
|
| 161 | - break; |
|
| 160 | + case 'bar': |
|
| 161 | + break; |
|
| 162 | 162 | |
| 163 | 163 | } |
| 164 | 164 | |
@@ -1,112 +1,112 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $i = 0; |
| 3 | 3 | do { |
| 4 | - echo $i; |
|
| 4 | + echo $i; |
|
| 5 | 5 | } while ($i > 0); |
| 6 | 6 | |
| 7 | 7 | do |
| 8 | 8 | { |
| 9 | - echo $i; |
|
| 9 | + echo $i; |
|
| 10 | 10 | } while ($i > 0); |
| 11 | 11 | |
| 12 | 12 | do |
| 13 | 13 | { |
| 14 | - echo $i; |
|
| 14 | + echo $i; |
|
| 15 | 15 | } |
| 16 | 16 | while ($i > 0); |
| 17 | 17 | |
| 18 | 18 | do { echo $i; } while ($i > 0); |
| 19 | 19 | |
| 20 | 20 | do{ |
| 21 | - echo $i; |
|
| 21 | + echo $i; |
|
| 22 | 22 | }while($i > 0); |
| 23 | 23 | |
| 24 | 24 | while ($i < 1) { |
| 25 | - echo $i; |
|
| 25 | + echo $i; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | while($i < 1){ |
| 29 | - echo $i; |
|
| 29 | + echo $i; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | while ($i < 1) { echo $i; } |
| 33 | 33 | |
| 34 | 34 | for ($i = 1; $i < 1; $i++) { |
| 35 | - echo $i; |
|
| 35 | + echo $i; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | for($i = 1; $i < 1; $i++){ |
| 39 | - echo $i; |
|
| 39 | + echo $i; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | for ($i = 1; $i < 1; $i++) { echo $i; } |
| 43 | 43 | |
| 44 | 44 | if ($i == 0) { |
| 45 | - $i = 1; |
|
| 45 | + $i = 1; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | if($i == 0){ |
| 49 | - $i = 1; |
|
| 49 | + $i = 1; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if ($i == 0) { $i = 1; } |
| 53 | 53 | |
| 54 | 54 | if ($i == 0) { |
| 55 | - $i = 1; |
|
| 55 | + $i = 1; |
|
| 56 | 56 | } else { |
| 57 | - $i = 0; |
|
| 57 | + $i = 0; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if ($i == 0) { |
| 61 | - $i = 1; |
|
| 61 | + $i = 1; |
|
| 62 | 62 | }else{ |
| 63 | - $i = 0; |
|
| 63 | + $i = 0; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if ($i == 0) { $i = 1; } else { $i = 0; } |
| 67 | 67 | |
| 68 | 68 | if ($i == 0) { |
| 69 | - $i = 1; |
|
| 69 | + $i = 1; |
|
| 70 | 70 | } else if ($i == 2) { |
| 71 | - $i = 0; |
|
| 71 | + $i = 0; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if ($i == 0) { |
| 75 | - $i = 1; |
|
| 75 | + $i = 1; |
|
| 76 | 76 | }else if($i == 2){ |
| 77 | - $i = 0; |
|
| 77 | + $i = 0; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } |
| 81 | 81 | |
| 82 | 82 | if ($i == 0) { // comments are allowed |
| 83 | - $i = 1; |
|
| 83 | + $i = 1; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ($i == 0) {// comments are allowed |
| 87 | - $i = 1; |
|
| 87 | + $i = 1; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if ($i == 0) { /* comments are allowed*/ |
| 91 | - $i = 1; |
|
| 91 | + $i = 1; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if ($i == 0) |
| 95 | 95 | { // this is ok |
| 96 | - $i = 1; |
|
| 96 | + $i = 1; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | if ($i == 0) /* this is ok */ { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | try { |
| 103 | - $code = 'this'; |
|
| 103 | + $code = 'this'; |
|
| 104 | 104 | } catch (Exception $e) { |
| 105 | - // Caught! |
|
| 105 | + // Caught! |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | try { $code = 'this'; } catch (Exception $e) { |
| 109 | - // Caught! |
|
| 109 | + // Caught! |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | do { echo $i; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | if ($i === 0) { |
| 116 | 116 | |
| 117 | - $i = 1 |
|
| 117 | + $i = 1 |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if ($a) { |
@@ -124,11 +124,11 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | foreach ($items as $item) { |
| 127 | - echo $item; |
|
| 127 | + echo $item; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | foreach($items as $item){ |
| 131 | - echo $item; |
|
| 131 | + echo $item; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if ($a && $b) // && $c) |
@@ -136,29 +136,29 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if ($a == 5) : |
| 139 | - echo "a equals 5"; |
|
| 140 | - echo "..."; |
|
| 139 | + echo "a equals 5"; |
|
| 140 | + echo "..."; |
|
| 141 | 141 | elseif ($a == 6) : |
| 142 | - echo "a equals 6"; |
|
| 143 | - echo "!!!"; |
|
| 142 | + echo "a equals 6"; |
|
| 143 | + echo "!!!"; |
|
| 144 | 144 | else : |
| 145 | - echo "a is neither 5 nor 6"; |
|
| 145 | + echo "a is neither 5 nor 6"; |
|
| 146 | 146 | endif; |
| 147 | 147 | |
| 148 | 148 | try { |
| 149 | - // try body |
|
| 149 | + // try body |
|
| 150 | 150 | } |
| 151 | 151 | catch (FirstExceptionType $e) { |
| 152 | - // catch body |
|
| 152 | + // catch body |
|
| 153 | 153 | } |
| 154 | 154 | catch (OtherExceptionType $e) { |
| 155 | - // catch body |
|
| 155 | + // catch body |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | switch($foo) { |
| 159 | 159 | |
| 160 | - case 'bar': |
|
| 161 | - break; |
|
| 160 | + case 'bar': |
|
| 161 | + break; |
|
| 162 | 162 | |
| 163 | 163 | } |
| 164 | 164 | |
@@ -173,17 +173,17 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | <?php |
| 175 | 175 | if ($foo === 1) { |
| 176 | - ?> |
|
| 176 | + ?> |
|
| 177 | 177 | <table><tr><td> |
| 178 | 178 | <?php |
| 179 | - echo '2'; |
|
| 180 | - ?> |
|
| 179 | + echo '2'; |
|
| 180 | + ?> |
|
| 181 | 181 | </td></tr></table> |
| 182 | 182 | <?php |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if ($test) { /*one space after the bracket*/ |
| 186 | - echo 'true'; |
|
| 186 | + echo 'true'; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | ?> |
@@ -196,38 +196,38 @@ discard block |
||
| 196 | 196 | <?php endforeach; ?> |
| 197 | 197 | |
| 198 | 198 | <?php foreach ($formset['Fieldset'] as $fieldset) : |
| 199 | - ?> |
|
| 199 | + ?> |
|
| 200 | 200 | hello |
| 201 | 201 | <?php endforeach; ?> |
| 202 | 202 | |
| 203 | 203 | <?php |
| 204 | 204 | $a = 1; $b = true; |
| 205 | 205 | if (1 === $a) : |
| 206 | - if ($b) { |
|
| 207 | - echo 'b'; |
|
| 208 | - } else { |
|
| 209 | - echo 'not b'; |
|
| 210 | - } |
|
| 206 | + if ($b) { |
|
| 207 | + echo 'b'; |
|
| 208 | + } else { |
|
| 209 | + echo 'not b'; |
|
| 210 | + } |
|
| 211 | 211 | else : |
| 212 | - echo 'not 1'; |
|
| 212 | + echo 'not 1'; |
|
| 213 | 213 | endif; |
| 214 | 214 | |
| 215 | 215 | // @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 |
| 216 | 216 | |
| 217 | 217 | if ($a == 5): |
| 218 | - echo "a equals 5"; |
|
| 219 | - echo "..."; |
|
| 218 | + echo "a equals 5"; |
|
| 219 | + echo "..."; |
|
| 220 | 220 | elseif ($a == 6): |
| 221 | - echo "a equals 6"; |
|
| 222 | - echo "!!!"; |
|
| 221 | + echo "a equals 6"; |
|
| 222 | + echo "!!!"; |
|
| 223 | 223 | else: |
| 224 | - echo "a is neither 5 nor 6"; |
|
| 224 | + echo "a is neither 5 nor 6"; |
|
| 225 | 225 | endif; |
| 226 | 226 | |
| 227 | 227 | switch($foo) { |
| 228 | 228 | |
| 229 | - case 'bar': |
|
| 230 | - break; |
|
| 229 | + case 'bar': |
|
| 230 | + break; |
|
| 231 | 231 | |
| 232 | 232 | } |
| 233 | 233 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | <?php endforeach; ?> |
| 250 | 250 | |
| 251 | 251 | <?php foreach ($formset['Fieldset'] as $fieldset): |
| 252 | - ?> |
|
| 252 | + ?> |
|
| 253 | 253 | hello |
| 254 | 254 | <?php endforeach; ?> |
| 255 | 255 | <?php |
@@ -272,22 +272,22 @@ discard block |
||
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | try { |
| 275 | - $x = 1; |
|
| 275 | + $x = 1; |
|
| 276 | 276 | } // stray comment here |
| 277 | 277 | catch (CustomException $exception) { |
| 278 | - $x = 2; |
|
| 278 | + $x = 2; |
|
| 279 | 279 | } |
| 280 | 280 | // phpcs:ignore Standard.Category.Sniff |
| 281 | 281 | catch (Exception $exception) { |
| 282 | - $x = 2; |
|
| 282 | + $x = 2; |
|
| 283 | 283 | } |
| 284 | 284 | finally { |
| 285 | - $x = 3; |
|
| 285 | + $x = 3; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if ($this) { |
| 289 | - if ($that) |
|
| 290 | - foo(${$a[$b]}); |
|
| 289 | + if ($that) |
|
| 290 | + foo(${$a[$b]}); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | while ( $level-- ) ob_end_clean(); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | endwhile; |
| 301 | 301 | |
| 302 | 302 | $r = match ($x) { |
| 303 | - 1 => 1, |
|
| 303 | + 1 => 1, |
|
| 304 | 304 | }; |
| 305 | 305 | |
| 306 | 306 | $r = match($x){1 => 1}; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | if ($i == 0) { |
| 61 | 61 | $i = 1; |
| 62 | -}else{ |
|
| 62 | +} else{ |
|
| 63 | 63 | $i = 0; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | if ($i == 0) { |
| 75 | 75 | $i = 1; |
| 76 | -}else if($i == 2){ |
|
| 76 | +} else if($i == 2){ |
|
| 77 | 77 | $i = 0; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -96,11 +96,13 @@ discard block |
||
| 96 | 96 | $i = 1; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | -if ($i == 0) /* this is ok */ { |
|
| 99 | +if ($i == 0) { |
|
| 100 | + /* this is ok */ { |
|
| 100 | 101 | } |
| 101 | 102 | |
| 102 | 103 | try { |
| 103 | 104 | $code = 'this'; |
| 105 | +} |
|
| 104 | 106 | } catch (Exception $e) { |
| 105 | 107 | // Caught! |
| 106 | 108 | } |
@@ -119,8 +121,7 @@ discard block |
||
| 119 | 121 | |
| 120 | 122 | if ($a) { |
| 121 | 123 | |
| 122 | -} |
|
| 123 | -elseif ($b) { |
|
| 124 | +} elseif ($b) { |
|
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | foreach ($items as $item) { |
@@ -131,27 +132,29 @@ discard block |
||
| 131 | 132 | echo $item; |
| 132 | 133 | } |
| 133 | 134 | |
| 134 | -if ($a && $b) // && $c) |
|
| 135 | +if ($a && $b) { |
|
| 136 | + // && $c) |
|
| 135 | 137 | { |
| 136 | 138 | } |
| 137 | 139 | |
| 138 | 140 | if ($a == 5) : |
| 139 | 141 | echo "a equals 5"; |
| 142 | +} |
|
| 140 | 143 | echo "..."; |
| 141 | 144 | elseif ($a == 6) : |
| 142 | 145 | echo "a equals 6"; |
| 143 | 146 | echo "!!!"; |
| 144 | -else : |
|
| 147 | +else { |
|
| 148 | + : |
|
| 145 | 149 | echo "a is neither 5 nor 6"; |
| 150 | +} |
|
| 146 | 151 | endif; |
| 147 | 152 | |
| 148 | 153 | try { |
| 149 | 154 | // try body |
| 150 | -} |
|
| 151 | -catch (FirstExceptionType $e) { |
|
| 155 | +} catch (FirstExceptionType $e) { |
|
| 152 | 156 | // catch body |
| 153 | -} |
|
| 154 | -catch (OtherExceptionType $e) { |
|
| 157 | +} catch (OtherExceptionType $e) { |
|
| 155 | 158 | // catch body |
| 156 | 159 | } |
| 157 | 160 | |
@@ -207,9 +210,10 @@ discard block |
||
| 207 | 210 | echo 'b'; |
| 208 | 211 | } else { |
| 209 | 212 | echo 'not b'; |
| 210 | - } |
|
| 211 | -else : |
|
| 213 | + } else { |
|
| 214 | + : |
|
| 212 | 215 | echo 'not 1'; |
| 216 | +} |
|
| 213 | 217 | endif; |
| 214 | 218 | |
| 215 | 219 | // @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 |
@@ -220,8 +224,10 @@ discard block |
||
| 220 | 224 | elseif ($a == 6): |
| 221 | 225 | echo "a equals 6"; |
| 222 | 226 | echo "!!!"; |
| 223 | -else: |
|
| 227 | +else { |
|
| 228 | + : |
|
| 224 | 229 | echo "a is neither 5 nor 6"; |
| 230 | +} |
|
| 225 | 231 | endif; |
| 226 | 232 | |
| 227 | 233 | switch($foo) { |
@@ -280,20 +286,23 @@ discard block |
||
| 280 | 286 | // phpcs:ignore Standard.Category.Sniff |
| 281 | 287 | catch (Exception $exception) { |
| 282 | 288 | $x = 2; |
| 283 | -} |
|
| 284 | -finally { |
|
| 289 | +} finally { |
|
| 285 | 290 | $x = 3; |
| 286 | 291 | } |
| 287 | 292 | |
| 288 | 293 | if ($this) { |
| 289 | - if ($that) |
|
| 290 | - foo(${$a[$b]}); |
|
| 291 | -} |
|
| 294 | + if ($that) { |
|
| 295 | + foo(${$a[$b]}); |
|
| 296 | + } |
|
| 297 | + } |
|
| 292 | 298 | |
| 293 | -while ( $level-- ) ob_end_clean(); |
|
| 299 | +while ( $level-- ) { |
|
| 300 | + ob_end_clean(); |
|
| 301 | +} |
|
| 294 | 302 | |
| 295 | -while ( $level-- ) |
|
| 303 | +while ( $level-- ) { |
|
| 296 | 304 | ob_end_clean(); |
| 305 | +} |
|
| 297 | 306 | |
| 298 | 307 | while ( $level-- ): |
| 299 | 308 | ob_end_clean(); |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | $i = 0; |
| 3 | 3 | do { |
| 4 | 4 | echo $i; |
| 5 | -} while ($i > 0); |
|
| 5 | +}while ($i > 0); |
|
| 6 | 6 | |
| 7 | 7 | do |
| 8 | 8 | { |
| 9 | 9 | echo $i; |
| 10 | -} while ($i > 0); |
|
| 10 | +}while ($i > 0); |
|
| 11 | 11 | |
| 12 | 12 | do |
| 13 | 13 | { |
@@ -15,17 +15,17 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | while ($i > 0); |
| 17 | 17 | |
| 18 | -do { echo $i; } while ($i > 0); |
|
| 18 | +do { echo $i; }while ($i > 0); |
|
| 19 | 19 | |
| 20 | -do{ |
|
| 20 | +do { |
|
| 21 | 21 | echo $i; |
| 22 | -}while($i > 0); |
|
| 22 | +}while ($i > 0); |
|
| 23 | 23 | |
| 24 | 24 | while ($i < 1) { |
| 25 | 25 | echo $i; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -while($i < 1){ |
|
| 28 | +while ($i < 1) { |
|
| 29 | 29 | echo $i; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | echo $i; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -for($i = 1; $i < 1; $i++){ |
|
| 38 | +for ($i = 1; $i < 1; $i++) { |
|
| 39 | 39 | echo $i; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $i = 1; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -if($i == 0){ |
|
| 48 | +if ($i == 0) { |
|
| 49 | 49 | $i = 1; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | if ($i == 0) { |
| 61 | 61 | $i = 1; |
| 62 | -}else{ |
|
| 62 | +} else { |
|
| 63 | 63 | $i = 0; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | if ($i == 0) { |
| 75 | 75 | $i = 1; |
| 76 | -}else if($i == 2){ |
|
| 76 | +} else if ($i == 2) { |
|
| 77 | 77 | $i = 0; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | do { echo $i; |
| 113 | -} while ($i > 0); |
|
| 113 | +}while ($i > 0); |
|
| 114 | 114 | |
| 115 | 115 | if ($i === 0) { |
| 116 | 116 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | echo $item; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | -foreach($items as $item){ |
|
| 130 | +foreach ($items as $item) { |
|
| 131 | 131 | echo $item; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | // catch body |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | -switch($foo) { |
|
| 158 | +switch ($foo) { |
|
| 159 | 159 | |
| 160 | 160 | case 'bar': |
| 161 | 161 | break; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | ?> |
| 169 | 169 | |
| 170 | -<?php while($row = $data->getRow()): ?> |
|
| 170 | +<?php while ($row = $data->getRow()): ?> |
|
| 171 | 171 | <p><?= $val ?></p> |
| 172 | 172 | <?php endwhile; ?> |
| 173 | 173 | |
@@ -182,13 +182,13 @@ discard block |
||
| 182 | 182 | <?php |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | -if ($test) { /*one space after the bracket*/ |
|
| 185 | +if ($test) { /*one space after the bracket*/ |
|
| 186 | 186 | echo 'true'; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | ?> |
| 190 | -<?php foreach($formset['Fieldset'] as $fieldset): ?> |
|
| 191 | - <?php foreach($fieldset['Field'] as $field): ?> |
|
| 190 | +<?php foreach ($formset['Fieldset'] as $fieldset): ?> |
|
| 191 | + <?php foreach ($fieldset['Field'] as $field): ?> |
|
| 192 | 192 | <?php endforeach; ?> |
| 193 | 193 | <?php endforeach; ?> |
| 194 | 194 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | echo "a is neither 5 nor 6"; |
| 225 | 225 | endif; |
| 226 | 226 | |
| 227 | -switch($foo) { |
|
| 227 | +switch ($foo) { |
|
| 228 | 228 | |
| 229 | 229 | case 'bar': |
| 230 | 230 | break; |
@@ -236,12 +236,12 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | ?> |
| 238 | 238 | |
| 239 | -<?php while($row = $data->getRow()) : ?> |
|
| 239 | +<?php while ($row = $data->getRow()) : ?> |
|
| 240 | 240 | <p><?= $val ?></p> |
| 241 | 241 | <?php endwhile; ?> |
| 242 | 242 | |
| 243 | -<?php foreach($formset['Fieldset'] as $fieldset) : ?> |
|
| 244 | - <?php foreach($fieldset['Field'] as $field) : ?> |
|
| 243 | +<?php foreach ($formset['Fieldset'] as $fieldset) : ?> |
|
| 244 | + <?php foreach ($fieldset['Field'] as $field) : ?> |
|
| 245 | 245 | <?php endforeach; ?> |
| 246 | 246 | <?php endforeach; ?> |
| 247 | 247 | |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | foo(${$a[$b]}); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | -while ( $level-- ) ob_end_clean(); |
|
| 293 | +while ($level--) ob_end_clean(); |
|
| 294 | 294 | |
| 295 | -while ( $level-- ) |
|
| 295 | +while ($level--) |
|
| 296 | 296 | ob_end_clean(); |
| 297 | 297 | |
| 298 | -while ( $level-- ): |
|
| 298 | +while ($level--): |
|
| 299 | 299 | ob_end_clean(); |
| 300 | 300 | endwhile; |
| 301 | 301 | |