@@ -78,7 +78,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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: |
@@ -86,15 +86,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | const ERROR_OPENING_ZIP_FILE = 338003; |
32 | 32 | |
33 | - const ERROR_CANNOT_SAVE_FILE_TO_DISK =338004; |
|
33 | + const ERROR_CANNOT_SAVE_FILE_TO_DISK = 338004; |
|
34 | 34 | |
35 | 35 | protected $options = array( |
36 | 36 | 'WriteThreshold' => 100 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @throws ZIPHelper_Exception |
76 | 76 | * @return bool |
77 | 77 | */ |
78 | - public function addFile($filePath, $zipPath=null) |
|
78 | + public function addFile($filePath, $zipPath = null) |
|
79 | 79 | { |
80 | 80 | $this->open(); |
81 | 81 | |
@@ -120,16 +120,16 @@ discard block |
||
120 | 120 | |
121 | 121 | protected function open() |
122 | 122 | { |
123 | - if($this->open) { |
|
123 | + if ($this->open) { |
|
124 | 124 | return; |
125 | 125 | } |
126 | 126 | |
127 | - if(!isset($this->zip)) { |
|
127 | + if (!isset($this->zip)) { |
|
128 | 128 | $this->zip = new \ZipArchive(); |
129 | 129 | } |
130 | 130 | |
131 | 131 | $flag = null; |
132 | - if(!file_exists($this->file)) { |
|
132 | + if (!file_exists($this->file)) { |
|
133 | 133 | $flag = \ZipArchive::CREATE; |
134 | 134 | } |
135 | 135 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | { |
170 | 170 | $this->fileTracker++; |
171 | 171 | |
172 | - if($this->options['WriteThreshold'] < 1) { |
|
172 | + if ($this->options['WriteThreshold'] < 1) { |
|
173 | 173 | return; |
174 | 174 | } |
175 | 175 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | protected function close() |
184 | 184 | { |
185 | - if(!$this->open) { |
|
185 | + if (!$this->open) { |
|
186 | 186 | return; |
187 | 187 | } |
188 | 188 | |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | throw new ZIPHelper_Exception( |
191 | 191 | 'Could not save ZIP file to disk', |
192 | 192 | sprintf( |
193 | - 'Tried saving the ZIP file [%1$s], but the write failed. This can have several causes, ' . |
|
194 | - 'including adding files that do not exist on disk, trying to create an empty zip, ' . |
|
193 | + 'Tried saving the ZIP file [%1$s], but the write failed. This can have several causes, '. |
|
194 | + 'including adding files that do not exist on disk, trying to create an empty zip, '. |
|
195 | 195 | 'or trying to save to a directory that does not exist.', |
196 | 196 | $this->file |
197 | 197 | ), |
@@ -228,22 +228,22 @@ discard block |
||
228 | 228 | * @see ZIPHelper::downloadAndDelete() |
229 | 229 | * @throws ZIPHelper_Exception |
230 | 230 | */ |
231 | - public function download($fileName=null) |
|
231 | + public function download($fileName = null) |
|
232 | 232 | { |
233 | 233 | $this->save(); |
234 | 234 | |
235 | - if(empty($fileName)) { |
|
235 | + if (empty($fileName)) { |
|
236 | 236 | $fileName = basename($this->file); |
237 | 237 | } |
238 | 238 | |
239 | 239 | header('Content-type: application/zip'); |
240 | - header('Content-Disposition: attachment; filename=' . $fileName); |
|
241 | - header('Content-length: ' . filesize($this->file)); |
|
240 | + header('Content-Disposition: attachment; filename='.$fileName); |
|
241 | + header('Content-length: '.filesize($this->file)); |
|
242 | 242 | header('Pragma: no-cache'); |
243 | 243 | header('Expires: 0'); |
244 | 244 | readfile($this->file); |
245 | 245 | |
246 | - if($this->exit === false) { |
|
246 | + if ($this->exit === false) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param string|NULL $fileName Override the ZIP's file name for the download |
260 | 260 | * @see ZIPHelper::download() |
261 | 261 | */ |
262 | - public function downloadAndDelete($fileName=null) |
|
262 | + public function downloadAndDelete($fileName = null) |
|
263 | 263 | { |
264 | 264 | $this->exit = false; |
265 | 265 | |
@@ -280,9 +280,9 @@ discard block |
||
280 | 280 | * @param string $outputFolder |
281 | 281 | * @return boolean |
282 | 282 | */ |
283 | - public function extractAll($outputFolder=null) |
|
283 | + public function extractAll($outputFolder = null) |
|
284 | 284 | { |
285 | - if(empty($outputFolder)) { |
|
285 | + if (empty($outputFolder)) { |
|
286 | 286 | $outputFolder = dirname($this->file); |
287 | 287 | } |
288 | 288 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * The converted string will be all lowercase. |
61 | 61 | * @return Transliteration |
62 | 62 | */ |
63 | - public function setLowercase(bool $lowercase=true) : Transliteration |
|
63 | + public function setLowercase(bool $lowercase = true) : Transliteration |
|
64 | 64 | { |
65 | 65 | $this->setOption('lowercase', true); |
66 | 66 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | $result = implode('', $keep); |
99 | 99 | |
100 | - while (strstr($result, $space . $space)) { |
|
101 | - $result = str_replace($space . $space, $space, $result); |
|
100 | + while (strstr($result, $space.$space)) { |
|
101 | + $result = str_replace($space.$space, $space, $result); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $result = trim($result, $space); |
@@ -17,7 +17,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | $this->path = realpath($path); |
53 | 53 | |
54 | - if($this->path === false) |
|
54 | + if ($this->path === false) |
|
55 | 55 | { |
56 | 56 | throw new FileHelper_Exception( |
57 | 57 | 'Cannot extract file information: file not found.', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $code = file_get_contents($this->path); |
132 | 132 | |
133 | - if($code === false) |
|
133 | + if ($code === false) |
|
134 | 134 | { |
135 | 135 | throw new FileHelper_Exception( |
136 | 136 | 'Cannot open file for parsing.', |
@@ -149,24 +149,24 @@ discard block |
||
149 | 149 | |
150 | 150 | $result = array(); |
151 | 151 | preg_match_all('/namespace[\s]+([^;]+);/six', $code, $result, PREG_PATTERN_ORDER); |
152 | - if(isset($result[0]) && isset($result[0][0])) { |
|
152 | + if (isset($result[0]) && isset($result[0][0])) { |
|
153 | 153 | $this->namespace = trim($result[1][0]); |
154 | 154 | } |
155 | 155 | |
156 | 156 | $result = array(); |
157 | 157 | preg_match_all('/(abstract|final)[\s]+class[\s]+([\sa-z0-9\\\\_,]+){|class[\s]+([\sa-z0-9\\\\_,]+){/six', $code, $result, PREG_PATTERN_ORDER); |
158 | 158 | |
159 | - if(!isset($result[0]) || !isset($result[0][0])) { |
|
159 | + if (!isset($result[0]) || !isset($result[0][0])) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
163 | 163 | $indexes = array_keys($result[0]); |
164 | 164 | |
165 | - foreach($indexes as $idx) |
|
165 | + foreach ($indexes as $idx) |
|
166 | 166 | { |
167 | 167 | $keyword = $result[1][$idx]; |
168 | 168 | $declaration = $result[2][$idx]; |
169 | - if(empty($keyword)) { |
|
169 | + if (empty($keyword)) { |
|
170 | 170 | $declaration = $result[3][$idx]; |
171 | 171 | } |
172 | 172 |
@@ -221,7 +221,7 @@ |
||
221 | 221 | */ |
222 | 222 | public static function getMime($extension) |
223 | 223 | { |
224 | - if(isset(self::$mimeTypes[$extension])) { |
|
224 | + if (isset(self::$mimeTypes[$extension])) { |
|
225 | 225 | return self::$mimeTypes[$extension]; |
226 | 226 | } |
227 | 227 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $name = $this->getName(); |
107 | 107 | |
108 | - if($this->info->hasNamespace()) { |
|
108 | + if ($this->info->hasNamespace()) { |
|
109 | 109 | $name = $this->info->getNamespace().'\\'.$this->name; |
110 | 110 | } |
111 | 111 | |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | $parts[] = 'class'; |
161 | 161 | $parts[] = $this->getName(); |
162 | 162 | |
163 | - if(!empty($this->extends)) { |
|
163 | + if (!empty($this->extends)) { |
|
164 | 164 | $parts[] = 'extends'; |
165 | 165 | $parts[] = $this->extends; |
166 | 166 | } |
167 | 167 | |
168 | - if(!empty($this->implements)) { |
|
168 | + if (!empty($this->implements)) { |
|
169 | 169 | $parts[] = 'implements'; |
170 | 170 | $parts[] = implode(', ', $this->implements); |
171 | 171 | } |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | |
185 | 185 | protected function analyzeCode() |
186 | 186 | { |
187 | - if($this->keyword == 'abstract') { |
|
187 | + if ($this->keyword == 'abstract') { |
|
188 | 188 | $this->abstract = true; |
189 | - } else if($this->keyword == 'final') { |
|
189 | + } else if ($this->keyword == 'final') { |
|
190 | 190 | $this->final = true; |
191 | 191 | } |
192 | 192 | |
@@ -203,16 +203,16 @@ discard block |
||
203 | 203 | |
204 | 204 | $tokenName = 'none'; |
205 | 205 | |
206 | - foreach($parts as $part) |
|
206 | + foreach ($parts as $part) |
|
207 | 207 | { |
208 | 208 | $part = str_replace(',', '', $part); |
209 | 209 | $part = trim($part); |
210 | - if(empty($part)) { |
|
210 | + if (empty($part)) { |
|
211 | 211 | continue; |
212 | 212 | } |
213 | 213 | |
214 | 214 | $name = strtolower($part); |
215 | - if($name == 'extends' || $name == 'implements') { |
|
215 | + if ($name == 'extends' || $name == 'implements') { |
|
216 | 216 | $tokenName = $name; |
217 | 217 | continue; |
218 | 218 | } |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | |
223 | 223 | $this->implements = $tokens['implements']; |
224 | 224 | |
225 | - if(!empty($this->implements)) { |
|
225 | + if (!empty($this->implements)) { |
|
226 | 226 | usort($this->implements, function(string $a, string $b) { |
227 | 227 | return strnatcasecmp($a, $b); |
228 | 228 | }); |
229 | 229 | } |
230 | 230 | |
231 | - if(!empty($tokens['extends'])) { |
|
231 | + if (!empty($tokens['extends'])) { |
|
232 | 232 | $this->extends = $tokens['extends'][0]; |
233 | 233 | } |
234 | 234 | } |
@@ -18,23 +18,23 @@ discard block |
||
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 |
||
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 |
||
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; |