@@ -69,7 +69,9 @@ |
||
69 | 69 | class Test |
70 | 70 | { |
71 | 71 | public function test() { |
72 | - if (1) 1; |
|
72 | + if (1) { |
|
73 | + 1; |
|
74 | + } |
|
73 | 75 | 1 ? (1 ? 1 : 1) : 1; |
74 | 76 | } |
75 | 77 | } |
@@ -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 |
@@ -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); |
@@ -17,7 +17,8 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | if ($one) { |
20 | -} else ($two) { |
|
20 | +} else { |
|
21 | + ($two) { |
|
21 | 22 | } else if ($three) { |
22 | 23 | } elseif ($four) { |
23 | 24 | } |
@@ -48,6 +49,7 @@ discard block |
||
48 | 49 | // There are no spaces before break. |
49 | 50 | } |
50 | 51 | break; |
52 | +} |
|
51 | 53 | |
52 | 54 | default: |
53 | 55 | if ($blah) { |
@@ -158,8 +160,7 @@ discard block |
||
158 | 160 | } |
159 | 161 | |
160 | 162 | if ($one) { |
161 | -} |
|
162 | -elseif ($two) { |
|
163 | +} elseif ($two) { |
|
163 | 164 | } |
164 | 165 | // else if something |
165 | 166 | else if ($three) { |
@@ -193,8 +194,7 @@ discard block |
||
193 | 194 | |
194 | 195 | try { |
195 | 196 | // Something |
196 | -} |
|
197 | -catch (Exception $e) { |
|
197 | +} catch (Exception $e) { |
|
198 | 198 | // Something |
199 | 199 | } |
200 | 200 |
@@ -697,8 +697,9 @@ |
||
697 | 697 | // Yes, code like this does exist. |
698 | 698 | if ($foo) { |
699 | 699 | return $foo; |
700 | -} elseif ($bar) |
|
700 | +} elseif ($bar) { |
|
701 | 701 | return $bar; |
702 | +} |
|
702 | 703 | |
703 | 704 | switch ($foo) { |
704 | 705 | case 1: |
@@ -60,8 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | while ($line=fgets($fp,2*1024*1024)) |
62 | 62 | { |
63 | - if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) |
|
64 | - continue; |
|
63 | + if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) { |
|
64 | + continue; |
|
65 | + } |
|
65 | 66 | print $line; |
66 | 67 | } |
67 | 68 | |
@@ -183,19 +184,21 @@ discard block |
||
183 | 184 | function test(){ |
184 | 185 | switch($a) { |
185 | 186 | case 1: |
186 | - if (empty($b)) |
|
187 | - return 0; |
|
187 | + if (empty($b)) { |
|
188 | + return 0; |
|
189 | + } |
|
188 | 190 | break; |
189 | 191 | default: |
190 | 192 | return 2; |
191 | 193 | } |
192 | 194 | |
193 | - if (empty($a)) |
|
194 | - echo '1'; |
|
195 | - elseif ($empty($b)) |
|
196 | - return 0; |
|
197 | - else |
|
198 | - return 1; |
|
195 | + if (empty($a)) { |
|
196 | + echo '1'; |
|
197 | + } elseif ($empty($b)) { |
|
198 | + return 0; |
|
199 | + } else { |
|
200 | + return 1; |
|
201 | + } |
|
199 | 202 | |
200 | 203 | echo "oi"; |
201 | 204 | return 1; |
@@ -203,8 +206,9 @@ discard block |
||
203 | 206 | |
204 | 207 | switch ($foo) { |
205 | 208 | case 'foo': |
206 | - if ($foo) |
|
207 | - return $foo; |
|
209 | + if ($foo) { |
|
210 | + return $foo; |
|
211 | + } |
|
208 | 212 | return $bar; |
209 | 213 | default: |
210 | 214 | return $bar; |
@@ -16,9 +16,3 @@ |
||
16 | 16 | $arr = array( |
17 | 17 | 'a' => 'a' |
18 | 18 | <<<<<<< HEAD |
19 | - 'b' => 'b' |
|
20 | -======= |
|
21 | - 'c' => 'c' |
|
22 | ->>>>>>> master |
|
23 | - ); |
|
24 | - } |
@@ -101,19 +101,22 @@ discard block |
||
101 | 101 | ){ |
102 | 102 | } |
103 | 103 | |
104 | -if ($condition1) |
|
104 | +if ($condition1) { |
|
105 | 105 | echo 'bar'; |
106 | +} |
|
106 | 107 | |
107 | 108 | if ($condition1 |
108 | 109 | || $condition2 |
109 | -|| $condition3) |
|
110 | +|| $condition3) { |
|
110 | 111 | echo 'bar'; |
112 | +} |
|
111 | 113 | |
112 | 114 | |
113 | 115 | if ($condition1 |
114 | 116 | || $condition2 || $condition3 |
115 | -) |
|
117 | +) { |
|
116 | 118 | echo 'bar'; |
119 | +} |
|
117 | 120 | |
118 | 121 | if (!empty($post) |
119 | 122 | && (!empty($context['header']) |
@@ -142,18 +145,22 @@ discard block |
||
142 | 145 | endif; |
143 | 146 | |
144 | 147 | if ($IPP->errorCode() == 401 || // comment |
145 | - $IPP->errorCode() == 3200) /* long comment |
|
148 | + $IPP->errorCode() == 3200) { |
|
149 | + /* long comment |
|
146 | 150 | here |
147 | 151 | */ |
148 | 152 | { |
149 | 153 | return false; |
150 | 154 | } |
155 | +} |
|
151 | 156 | |
152 | 157 | if ($IPP->errorCode() == 401 || // comment |
153 | - $IPP->errorCode() == 3200) // long comment here |
|
158 | + $IPP->errorCode() == 3200) { |
|
159 | + // long comment here |
|
154 | 160 | { |
155 | 161 | return false; |
156 | 162 | } |
163 | +} |
|
157 | 164 | |
158 | 165 | if ($IPP->errorCode() == 401 |
159 | 166 | // Comment explaining the next condition here. |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | if ($i == 0) { |
83 | 83 | $i = 1; |
84 | -}else{ |
|
84 | +} else{ |
|
85 | 85 | $i = 0; |
86 | 86 | } |
87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | if ($i == 0) { |
99 | 99 | $i = 1; |
100 | -}else{ |
|
100 | +} else{ |
|
101 | 101 | $i = 0; |
102 | 102 | } |
103 | 103 | |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | |
120 | 120 | if ($i == 0) { |
121 | 121 | $i = 1; |
122 | -}else if($i == 2){ |
|
122 | +} else if($i == 2){ |
|
123 | 123 | $i = 0; |
124 | 124 | } |
125 | 125 | |
126 | 126 | if ($i == 0) { |
127 | 127 | $i = 1; |
128 | -}elseif($i == 2){ |
|
128 | +} elseif($i == 2){ |
|
129 | 129 | $i = 0; |
130 | 130 | } |
131 | 131 | |
@@ -153,7 +153,6 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | if ($i == 0) { |
156 | -} |
|
157 | -else { |
|
156 | +} else { |
|
158 | 157 | } |
159 | 158 | ?> |
160 | 159 | \ No newline at end of file |