Passed
Branch master (f6a670)
by Sebastian
07:16 queued 02:32
created
src/SVNHelper/Command/Status.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $result = $this->execCommand('status', $this->target->getPath(), array('depth empty'));
51 51
         
52
-        if($result->isError()) {
52
+        if ($result->isError()) {
53 53
             $this->throwExceptionUnexpected($result);
54 54
         }
55 55
 
56 56
         $lines = $result->getOutput();
57 57
         
58
-        if(empty($lines)) 
58
+        if (empty($lines)) 
59 59
         {
60 60
             $this->status = self::STATUS_NOT_MODIFIED;
61 61
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $this->status = self::STATUS_UNKNOWN;
65 65
             
66 66
             $svnStatusCode = strtolower(substr($lines[0], 0, 1));
67
-            if(isset(self::$knownStati[$svnStatusCode])) {
67
+            if (isset(self::$knownStati[$svnStatusCode])) {
68 68
                $this->status = self::$knownStati[$svnStatusCode];
69 69
             }
70 70
         }
Please login to merge, or discard this patch.
src/IniHelper/Line.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->trimmed = trim($text);
79 79
         $this->lineNumber = $lineNumber;
80 80
         
81
-        if(empty($this->trimmed)) 
81
+        if (empty($this->trimmed)) 
82 82
         {
83 83
             $this->type = self::TYPE_EMPTY;
84 84
             return;
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
         
87 87
         $startChar = substr($this->trimmed, 0, 1);
88 88
         
89
-        if($startChar === ';')
89
+        if ($startChar === ';')
90 90
         {
91 91
             $this->type = self::TYPE_COMMENT;
92 92
         }
93
-        else if($startChar === '[')
93
+        else if ($startChar === '[')
94 94
         {
95 95
             $this->type = self::TYPE_SECTION_DECLARATION;
96 96
             $this->sectionName = trim($this->trimmed, '[]');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         else
100 100
         {
101 101
             $pos = strpos($this->trimmed, '=');
102
-            if($pos === false) 
102
+            if ($pos === false) 
103 103
             {
104 104
                 $this->type = self::TYPE_INVALID;
105 105
                 return;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $this->type = self::TYPE_VALUE;
109 109
             $this->varName = trim(substr($this->trimmed, 0, $pos));
110 110
             
111
-            $this->parseValue(substr($this->trimmed, $pos+1));
111
+            $this->parseValue(substr($this->trimmed, $pos + 1));
112 112
         }
113 113
     }
114 114
     
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
         
119 119
         $value = $this->varValue;
120 120
         
121
-        if(substr($value, 0, 1) == '"' && substr($value, -1, 1) == '"')
121
+        if (substr($value, 0, 1) == '"' && substr($value, -1, 1) == '"')
122 122
         {
123 123
             $value = trim($value, '"');
124 124
             $this->quoteStyle = '"';
125 125
         }
126
-        else if(substr($value, 0, 1) == "'" && substr($value, -1, 1) == "'")
126
+        else if (substr($value, 0, 1) == "'" && substr($value, -1, 1) == "'")
127 127
         {
128 128
             $value = trim($value, "'");
129 129
             $this->quoteStyle = "'";
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     
145 145
     public function getQuotedVarValue() : string
146 146
     {
147
-        if($this->quoteStyle === '') {
147
+        if ($this->quoteStyle === '') {
148 148
             return $this->getVarValue();
149 149
         }
150 150
         
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     
199 199
     public function setValue($value) : IniHelper_Line
200 200
     {
201
-        if(!is_scalar($value)) 
201
+        if (!is_scalar($value)) 
202 202
         {
203 203
             throw new IniHelper_Exception(
204 204
                 'Cannot use non-scalar values.',
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     
219 219
     public function toString() : string
220 220
     {
221
-        switch($this->type) 
221
+        switch ($this->type) 
222 222
         {
223 223
             case self::TYPE_EMPTY:
224 224
             case self::TYPE_INVALID:
Please login to merge, or discard this patch.
src/IniHelper/Section.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $result = array();
88 88
         
89
-        foreach($this->lines as $line)
89
+        foreach ($this->lines as $line)
90 90
         {
91
-            if(!$line->isValue()) {
91
+            if (!$line->isValue()) {
92 92
                 continue;
93 93
             }
94 94
 
95 95
             $name = $line->getVarName();
96 96
             
97
-            if(!isset($result[$name])) 
97
+            if (!isset($result[$name])) 
98 98
             {
99 99
                 $result[$name] = $line->getVarValue();
100 100
                 continue;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             // name exists in collection? Then this is a
104 104
             // duplicate key and we need to convert it to
105 105
             // an indexed array of values.
106
-            if(!is_array($result[$name])) 
106
+            if (!is_array($result[$name])) 
107 107
             {
108 108
                 $result[$name] = array($result[$name]);
109 109
             }
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
     public function toString()
123 123
     {
124 124
         $lines = array();
125
-        if(!$this->isDefault()) 
125
+        if (!$this->isDefault()) 
126 126
         {
127 127
             $lines[] = '['.$this->getName().']';
128 128
         }
129 129
         
130
-        foreach($this->lines as $line) 
130
+        foreach ($this->lines as $line) 
131 131
         {
132 132
             // we already did this
133
-            if($line->isSection()) {
133
+            if ($line->isSection()) {
134 134
                 continue;
135 135
             }
136 136
             
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
     {
151 151
         $keep = array();
152 152
         
153
-        foreach($this->lines as $line)
153
+        foreach ($this->lines as $line)
154 154
         {
155
-            if($line !== $toDelete) {
155
+            if ($line !== $toDelete) {
156 156
                 $keep[] = $line;
157 157
             }
158 158
         }
@@ -177,23 +177,23 @@  discard block
 block discarded – undo
177 177
         // Removes any superfluous values that may
178 178
         // already exist, if there are more than the
179 179
         // new set of values.
180
-        if(is_array($value))
180
+        if (is_array($value))
181 181
         {
182 182
             $values = array_values($value);
183 183
             $amountNew = count($values);
184 184
             $amountExisting = count($lines);
185 185
             
186 186
             $max = $amountNew;
187
-            if($amountExisting > $max) {
187
+            if ($amountExisting > $max) {
188 188
                 $max = $amountExisting;
189 189
             }
190 190
             
191
-            for($i=0; $i < $max; $i++) 
191
+            for ($i = 0; $i < $max; $i++) 
192 192
             {
193 193
                 // new value exists
194
-                if(isset($values[$i]))
194
+                if (isset($values[$i]))
195 195
                 {
196
-                    if(isset($lines[$i])) {
196
+                    if (isset($lines[$i])) {
197 197
                         $lines[$i]->setValue($values[$i]);
198 198
                     } else {
199 199
                         $this->addValueLine($name, $values[$i]);
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
         else
212 212
         {
213 213
             // remove all superfluous lines
214
-            if(!empty($lines))
214
+            if (!empty($lines))
215 215
             {
216 216
                 $line = array_shift($lines); // keep only the first line
217 217
                 $line->setValue($value);
218 218
                 
219
-                foreach($lines as $delete) {
219
+                foreach ($lines as $delete) {
220 220
                     $this->deleteLine($delete);
221 221
                 }
222 222
             }
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
     public function addValue(string $name, $value) : IniHelper_Section
242 242
     {
243 243
         // array value? Treat it as duplicate keys.
244
-        if(is_array($value))
244
+        if (is_array($value))
245 245
         {
246 246
             $values = array_values($value);
247 247
             
248
-            foreach($values as $setValue)
248
+            foreach ($values as $setValue)
249 249
             {
250 250
                 $this->addValue($name, $setValue);
251 251
             }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         
256 256
         $lines = $this->getLinesByVariable($name);
257 257
         
258
-        if(empty($lines))
258
+        if (empty($lines))
259 259
         {
260 260
             $this->addValueLine($name, $value);
261 261
         }
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
         {
264 264
             $found = false;
265 265
             
266
-            foreach($lines as $line)
266
+            foreach ($lines as $line)
267 267
             {
268
-                if($line->getVarValue() === $value) {
268
+                if ($line->getVarValue() === $value) {
269 269
                     $found = $line;
270 270
                     break;
271 271
                 }
272 272
             }
273 273
             
274
-            if(!$found)
274
+            if (!$found)
275 275
             {
276 276
                 $this->addValueLine($name, $value);
277 277
             }
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $result = array();
307 307
         
308
-        foreach($this->lines as $line)
308
+        foreach ($this->lines as $line)
309 309
         {
310
-            if($line->isValue() && $line->getVarName() === $name) {
310
+            if ($line->isValue() && $line->getVarName() === $name) {
311 311
                 $result[] = $line;
312 312
             }
313 313
         }
Please login to merge, or discard this patch.
src/CSVHelper/Builder.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         return $this->setOption('separatorChar', $char);
18 18
     }
19 19
     
20
-    public function setTrailingNewline($useNewline=true)
20
+    public function setTrailingNewline($useNewline = true)
21 21
     {
22 22
         return $this->setOption('trailingNewline', $useNewline);
23 23
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $args = $args[0];
39 39
         }
40 40
 
41
-        $this->lines[] = '"' . implode('"'.$this->getOption('separatorChar').'"', $args) . '"';
41
+        $this->lines[] = '"'.implode('"'.$this->getOption('separatorChar').'"', $args).'"';
42 42
         
43 43
         return $this;
44 44
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $csv = implode(PHP_EOL, $this->lines);
56 56
 
57
-        if($this->getOption('trailingNewline')) {
57
+        if ($this->getOption('trailingNewline')) {
58 58
             $csv .= PHP_EOL;
59 59
         }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     
66 66
     public function setOption($name, $value)
67 67
     {
68
-        if(!isset($this->options)) {
68
+        if (!isset($this->options)) {
69 69
             $this->options = $this->getDefaultOptions();
70 70
         }
71 71
         
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
     
76 76
     public function setOptions($options)
77 77
     {
78
-        foreach($options as $name => $value) {
78
+        foreach ($options as $name => $value) {
79 79
             $this->setOption($name, $value);
80 80
         }
81 81
         
82 82
         return $this;
83 83
     }
84 84
     
85
-    public function getOption($name, $default=null)
85
+    public function getOption($name, $default = null)
86 86
     {
87
-        if(!isset($this->options)) {
87
+        if (!isset($this->options)) {
88 88
             $this->options = $this->getDefaultOptions();
89 89
         }
90 90
         
91
-        if(isset($this->options[$name])) {
91
+        if (isset($this->options[$name])) {
92 92
             return $this->options[$name];
93 93
         }
94 94
         
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     
98 98
     public function hasOption($name)
99 99
     {
100
-        if(!isset($this->options)) {
100
+        if (!isset($this->options)) {
101 101
             $this->options = $this->getDefaultOptions();
102 102
         }
103 103
         
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     
107 107
     public function getOptions()
108 108
     {
109
-        if(!isset($this->options)) {
109
+        if (!isset($this->options)) {
110 110
             $this->options = $this->getDefaultOptions();
111 111
         }
112 112
         
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     
116 116
     public function isOption($name, $value)
117 117
     {
118
-        if($this->getOption($name) === $value) {
118
+        if ($this->getOption($name) === $value) {
119 119
             return true;
120 120
         }
121 121
         
Please login to merge, or discard this patch.
src/ImageHelper/Size.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@  discard block
 block discarded – undo
18 18
     
19 19
     public function __construct(array $size)
20 20
     {
21
-        if(!isset($size['width'])) {
21
+        if (!isset($size['width'])) {
22 22
             $size['width'] = $size[0];
23 23
         }
24 24
         
25
-        if(!isset($size['height'])) {
25
+        if (!isset($size['height'])) {
26 26
             $size['height'] = $size[1];
27 27
         }
28 28
         
29
-        if(!isset($size[0])) {
29
+        if (!isset($size[0])) {
30 30
             $size[0] = $size['width'];
31 31
         }
32 32
         
33
-        if(!isset($size[1])) {
33
+        if (!isset($size[1])) {
34 34
             $size[1] = $size['height'];
35 35
         }
36 36
         
37
-        if(!isset($size['channels'])) {
37
+        if (!isset($size['channels'])) {
38 38
             $size['channels'] = 1;
39 39
         }
40 40
         
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     
69 69
     public function offsetGet($offset)
70 70
     {
71
-        if(isset($this->size[$offset])) {
71
+        if (isset($this->size[$offset])) {
72 72
             return $this->size[$offset];
73 73
         }
74 74
         
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     
78 78
     public function offsetSet($offset, $value)
79 79
     {
80
-        if(is_null($offset)) {
80
+        if (is_null($offset)) {
81 81
             $this->size[] = $value;
82 82
         } else {
83 83
             $this->size[$offset] = $value;
Please login to merge, or discard this patch.
examples/URLInfo/highlighting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 		<br>
43 43
         <?php
44 44
         
45
-            foreach($urls as $url)
45
+            foreach ($urls as $url)
46 46
             {
47 47
                 $info = parseURL($url);
48 48
                 
Please login to merge, or discard this patch.
examples/prepend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     $autoload = realpath($root.'/../vendor/autoload.php');
13 13
     
14 14
     // we need the autoloader to be present
15
-    if($autoload === false) 
15
+    if ($autoload === false) 
16 16
     {
17 17
         die('<b>ERROR:</b> Autoloader not present. Run composer update first.');
18 18
     }
Please login to merge, or discard this patch.
src/PaginationHelper.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     */
114 114
     public function getNextPage() : int
115 115
     {
116
-        if($this->next === 0) {
116
+        if ($this->next === 0) {
117 117
             return $this->last;
118 118
         }
119 119
         
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     */
138 138
     public function getPreviousPage() : int
139 139
     {
140
-        if($this->prev === 0) {
140
+        if ($this->prev === 0) {
141 141
             return 1;
142 142
         }
143 143
         
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         // adjust the adjacent value if it exceeds the
183 183
         // total amount of pages
184 184
         $adjacentTotal = ($adjacent * 2) + 1;
185
-        if($adjacentTotal > $this->last) 
185
+        if ($adjacentTotal > $this->last) 
186 186
         {
187 187
             $adjacent = (int)floor($this->last / 2);
188 188
         }
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
         $back = 0;
196 196
         $fwd = 0;
197 197
         
198
-        if($maxBack >= $adjacent) {
198
+        if ($maxBack >= $adjacent) {
199 199
             $back = $adjacent; 
200 200
         } else {
201 201
             $back = $maxBack;
202 202
         }
203 203
         
204
-        if($maxFwd >= $adjacent)  {
204
+        if ($maxFwd >= $adjacent) {
205 205
             $fwd = $adjacent;
206 206
         } else {
207 207
             $fwd = $maxFwd;
@@ -217,16 +217,16 @@  discard block
 block discarded – undo
217 217
         $fwd += $backDiff;
218 218
         $back += $fwdDiff;
219 219
         
220
-        if($fwd > $maxFwd) { $fwd = $maxFwd; }
221
-        if($back > $maxBack) { $back = $maxBack; }
220
+        if ($fwd > $maxFwd) { $fwd = $maxFwd; }
221
+        if ($back > $maxBack) { $back = $maxBack; }
222 222
         
223 223
         // calculate the first and last page in the list
224 224
         $prev = $this->current - $back;
225 225
         $next = $this->current + $fwd;
226 226
         
227 227
         // failsafe so we stay within the bounds
228
-        if($prev < 1) { $prev = 1; }
229
-        if($next > $this->last) { $next = $this->last; }
228
+        if ($prev < 1) { $prev = 1; }
229
+        if ($next > $this->last) { $next = $this->last; }
230 230
         
231 231
         // create and return the page numbers list
232 232
         $numbers = range($prev, $next);
@@ -319,11 +319,11 @@  discard block
 block discarded – undo
319 319
     {
320 320
         $pages = (int)ceil($this->total / $this->perPage);
321 321
         
322
-        if($this->current < 1)
322
+        if ($this->current < 1)
323 323
         {
324 324
             $this->current = 1;
325 325
         }
326
-        else if($this->current > $pages)
326
+        else if ($this->current > $pages)
327 327
         {
328 328
             $this->current = $pages;
329 329
         }
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
         $this->last = $pages;
332 332
         
333 333
         $nextPage = $this->current + 1;
334
-        if($nextPage <= $pages) {
334
+        if ($nextPage <= $pages) {
335 335
             $this->next = $nextPage;
336 336
         }
337 337
         
338 338
         $prevPage = $this->current - 1;
339
-        if($prevPage > 0) {
339
+        if ($prevPage > 0) {
340 340
             $this->prev = $prevPage;
341 341
         }
342 342
         
343 343
         $this->offsetStart = ($this->current - 1) * $this->perPage;
344 344
         
345 345
         $this->offsetEnd = $this->offsetStart + $this->perPage;
346
-        if($this->offsetEnd > ($this->total - 1)) {
346
+        if ($this->offsetEnd > ($this->total - 1)) {
347 347
             $this->offsetEnd = ($this->total - 1);
348 348
         }
349 349
     }
Please login to merge, or discard this patch.
src/IniHelper.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $section = $this->addSection(self::SECTION_DEFAULT);
37 37
         
38
-        if(empty($iniString)) {
38
+        if (empty($iniString)) {
39 39
             return;
40 40
         }
41 41
         
42 42
         $eol = ConvertHelper::detectEOLCharacter($iniString);
43
-        if($eol !== null) {
43
+        if ($eol !== null) {
44 44
             $this->eol = $eol->getCharacter();
45 45
         }
46 46
         
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
         
49 49
         $total = count($lines);
50 50
         
51
-        for($i=0; $i < $total; $i++) 
51
+        for ($i = 0; $i < $total; $i++) 
52 52
         {
53 53
             $line = new IniHelper_Line($lines[$i], $i);
54 54
             
55
-            if($line->isSection()) {
55
+            if ($line->isSection()) {
56 56
                 $section = $this->addSection($line->getSectionName());
57 57
             }
58 58
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $iniPath = FileHelper::requireFileExists($iniPath);
83 83
         
84 84
         $content = file_get_contents($iniPath);
85
-        if($content !== false) {
85
+        if ($content !== false) {
86 86
             return self::createFromString($content);
87 87
         }
88 88
         
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     */
128 128
     public function addSection(string $name) : IniHelper_Section
129 129
     {
130
-        if(!isset($this->sections[$name])) {
130
+        if (!isset($this->sections[$name])) {
131 131
             $this->sections[$name] = new IniHelper_Section($this, $name);
132 132
         }
133 133
         
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     */
143 143
     public function getSection(string $name) : ?IniHelper_Section
144 144
     {
145
-        if(isset($this->sections[$name])) {
145
+        if (isset($this->sections[$name])) {
146 146
             return $this->sections[$name];
147 147
         }
148 148
         
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
     {
159 159
         $result = array();
160 160
         
161
-        foreach($this->sections as $section)
161
+        foreach ($this->sections as $section)
162 162
         {
163
-            if($section->isDefault()) 
163
+            if ($section->isDefault()) 
164 164
             {
165 165
                 $result = array_merge($result, $section->toArray());
166 166
             } 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $parts = array();
202 202
         
203
-        foreach($this->sections as $section)
203
+        foreach ($this->sections as $section)
204 204
         {
205 205
             $parts[] = $section->toString();
206 206
         }
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
     */
244 244
     public function sectionExists(string $name) : bool
245 245
     {
246
-        foreach($this->sections as $section) {
247
-            if($section->getName() === $name) {
246
+        foreach ($this->sections as $section) {
247
+            if ($section->getName() === $name) {
248 248
                 return true;
249 249
             }
250 250
         }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     {
274 274
         $path = $this->parsePath($path);
275 275
         
276
-        if(!$this->sectionExists($path['section'])) {
276
+        if (!$this->sectionExists($path['section'])) {
277 277
             return array();
278 278
         }
279 279
         
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $path = explode($this->pathSeparator, $path);
286 286
         
287
-        if(count($path) === 1)
287
+        if (count($path) === 1)
288 288
         {
289 289
             return array(
290 290
                 'section' => self::SECTION_DEFAULT,
Please login to merge, or discard this patch.