@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | $lines[] = '--'.$this->boundaries->getMimeBoundary(); |
114 | 114 | $lines[] = $this->renderContentDisposition(); |
115 | 115 | |
116 | - if(!empty($this->contentType)) |
|
116 | + if (!empty($this->contentType)) |
|
117 | 117 | { |
118 | 118 | $lines[] = $this->renderContentType(); |
119 | 119 | } |
120 | 120 | |
121 | - if(!empty($this->transferEncoding)) |
|
121 | + if (!empty($this->transferEncoding)) |
|
122 | 122 | { |
123 | 123 | $lines[] = $this->renderTransferEncoding(); |
124 | 124 | } |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | { |
134 | 134 | $result = 'Content-Disposition: form-data'; |
135 | 135 | |
136 | - foreach($this->dispositionParams as $name => $value) |
|
136 | + foreach ($this->dispositionParams as $name => $value) |
|
137 | 137 | { |
138 | - $result .= '; '.$name.'="' . $value . '"'; |
|
138 | + $result .= '; '.$name.'="'.$value.'"'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | return $result; |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | |
144 | 144 | protected function renderContentType() : string |
145 | 145 | { |
146 | - $result = 'Content-Type: ' . $this->contentType; |
|
146 | + $result = 'Content-Type: '.$this->contentType; |
|
147 | 147 | |
148 | - if(!empty($this->contentEncoding)) |
|
148 | + if (!empty($this->contentEncoding)) |
|
149 | 149 | { |
150 | - $result .= '; charset="' . $this->contentEncoding.'"'; |
|
150 | + $result .= '; charset="'.$this->contentEncoding.'"'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return $result; |
@@ -155,6 +155,6 @@ discard block |
||
155 | 155 | |
156 | 156 | protected function renderTransferEncoding() : string |
157 | 157 | { |
158 | - return 'Content-Transfer-Encoding: ' . $this->transferEncoding; |
|
158 | + return 'Content-Transfer-Encoding: '.$this->transferEncoding; |
|
159 | 159 | } |
160 | 160 | } |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @param array<mixed>|null $serialized |
68 | 68 | * @throws BaseException |
69 | 69 | */ |
70 | - public function __construct($value, ?array $serialized=null) |
|
70 | + public function __construct($value, ?array $serialized = null) |
|
71 | 71 | { |
72 | - if(is_array($serialized)) |
|
72 | + if (is_array($serialized)) |
|
73 | 73 | { |
74 | 74 | $this->parseSerialized($serialized); |
75 | 75 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function parseSerialized(array $serialized) : void |
119 | 119 | { |
120 | - if(!isset($serialized['string'], $serialized['type'], $serialized['options'])) |
|
120 | + if (!isset($serialized['string'], $serialized['type'], $serialized['options'])) |
|
121 | 121 | { |
122 | 122 | throw new BaseException( |
123 | 123 | 'Invalid variable info serialized data.', |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | |
144 | 144 | // Gettype will return a string like "Resource(closed)" when |
145 | 145 | // working with a resource that has already been closed. |
146 | - if(stripos($this->type, 'resource') !== false) |
|
146 | + if (stripos($this->type, 'resource') !== false) |
|
147 | 147 | { |
148 | 148 | $this->type = self::TYPE_RESOURCE; |
149 | 149 | } |
150 | 150 | |
151 | - if(is_callable($value) && in_array($this->type, $this->callableTypes)) { |
|
151 | + if (is_callable($value) && in_array($this->type, $this->callableTypes)) { |
|
152 | 152 | $this->type = self::TYPE_CALLABLE; |
153 | 153 | } |
154 | 154 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param bool $enable |
193 | 193 | * @return VariableInfo |
194 | 194 | */ |
195 | - public function enableType(bool $enable=true) : VariableInfo |
|
195 | + public function enableType(bool $enable = true) : VariableInfo |
|
196 | 196 | { |
197 | 197 | return $this->setOption('prepend-type', $enable); |
198 | 198 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | { |
202 | 202 | $converted = $this->string; |
203 | 203 | |
204 | - if($this->getOption('prepend-type') === true && !$this->isNull()) |
|
204 | + if ($this->getOption('prepend-type') === true && !$this->isNull()) |
|
205 | 205 | { |
206 | - if($this->isString()) |
|
206 | + if ($this->isString()) |
|
207 | 207 | { |
208 | 208 | $converted = '"'.$converted.'"'; |
209 | 209 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->traverseChildren(); |
97 | 97 | $this->encodeTextElements(); |
98 | 98 | |
99 | - if(is_array($this->result) && !empty($this->result)) |
|
99 | + if (is_array($this->result) && !empty($this->result)) |
|
100 | 100 | { |
101 | 101 | return $this->result; |
102 | 102 | } |
@@ -107,20 +107,20 @@ discard block |
||
107 | 107 | |
108 | 108 | protected function detectAttributes() : void |
109 | 109 | { |
110 | - if(!$this->options['@attributes']) { |
|
110 | + if (!$this->options['@attributes']) { |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
114 | 114 | $attributes = $this->subject->attributes(); |
115 | 115 | |
116 | - if($attributes === null) |
|
116 | + if ($attributes === null) |
|
117 | 117 | { |
118 | 118 | return; |
119 | 119 | } |
120 | 120 | |
121 | 121 | $values = array_map('strval', iterator_to_array($attributes)); |
122 | 122 | |
123 | - if(!empty($values)) |
|
123 | + if (!empty($values)) |
|
124 | 124 | { |
125 | 125 | $this->result['@attributes'] = $values; |
126 | 126 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $children = $this->subject; |
132 | 132 | $depth = $this->options['depth'] - 1; |
133 | 133 | |
134 | - if($depth <= 0) |
|
134 | + if ($depth <= 0) |
|
135 | 135 | { |
136 | 136 | $children = []; |
137 | 137 | } |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | |
145 | 145 | $decorator->options = ['depth' => $depth] + $this->options; |
146 | 146 | |
147 | - if(isset($this->result[$name])) |
|
147 | + if (isset($this->result[$name])) |
|
148 | 148 | { |
149 | - if(!is_array($this->result[$name])) |
|
149 | + if (!is_array($this->result[$name])) |
|
150 | 150 | { |
151 | 151 | $this->result[$name] = array($this->result[$name]); |
152 | 152 | } |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | // json encode non-whitespace element simplexml text values. |
166 | 166 | $text = trim((string)$this->subject); |
167 | 167 | |
168 | - if($text !== '') |
|
168 | + if ($text !== '') |
|
169 | 169 | { |
170 | - if($this->options['@text']) |
|
170 | + if ($this->options['@text']) |
|
171 | 171 | { |
172 | 172 | $this->result['@text'] = $text; |
173 | 173 | } |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct(array $libxmlErrors) |
37 | 37 | { |
38 | - foreach($libxmlErrors as $error) |
|
38 | + foreach ($libxmlErrors as $error) |
|
39 | 39 | { |
40 | - if($error instanceof XMLHelper_DOMErrors_Error) |
|
40 | + if ($error instanceof XMLHelper_DOMErrors_Error) |
|
41 | 41 | { |
42 | 42 | $this->errors[] = $error; |
43 | 43 | } |
44 | - else if($error instanceof LibXMLError) |
|
44 | + else if ($error instanceof LibXMLError) |
|
45 | 45 | { |
46 | 46 | $this->errors[] = new XMLHelper_DOMErrors_Error($error); |
47 | 47 | } |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | { |
132 | 132 | $result = array(); |
133 | 133 | |
134 | - foreach($this->errors as $error) |
|
134 | + foreach ($this->errors as $error) |
|
135 | 135 | { |
136 | - if($error->isLevel($level)) |
|
136 | + if ($error->isLevel($level)) |
|
137 | 137 | { |
138 | 138 | $result[] = $error; |
139 | 139 | } |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | { |
153 | 153 | $result = array(); |
154 | 154 | |
155 | - foreach($this->errors as $error) |
|
155 | + foreach ($this->errors as $error) |
|
156 | 156 | { |
157 | - if($error->isCode($code)) |
|
157 | + if ($error->isCode($code)) |
|
158 | 158 | { |
159 | 159 | $result[] = $error; |
160 | 160 | } |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function hasErrorsByLevel(int $level) : bool |
173 | 173 | { |
174 | - foreach($this->errors as $error) |
|
174 | + foreach ($this->errors as $error) |
|
175 | 175 | { |
176 | - if($error->isLevel($level)) |
|
176 | + if ($error->isLevel($level)) |
|
177 | 177 | { |
178 | 178 | return true; |
179 | 179 | } |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function hasErrorsByCode(int $code) : bool |
192 | 192 | { |
193 | - foreach($this->errors as $error) |
|
193 | + foreach ($this->errors as $error) |
|
194 | 194 | { |
195 | - if($error->isCode($code)) |
|
195 | + if ($error->isCode($code)) |
|
196 | 196 | { |
197 | 197 | return true; |
198 | 198 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $result = array(); |
210 | 210 | |
211 | - foreach($this->errors as $error) |
|
211 | + foreach ($this->errors as $error) |
|
212 | 212 | { |
213 | 213 | $result[] = $error->toArray(); |
214 | 214 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | { |
228 | 228 | $data = array(); |
229 | 229 | |
230 | - foreach($this->errors as $error) |
|
230 | + foreach ($this->errors as $error) |
|
231 | 231 | { |
232 | 232 | $data[] = $error->serialize(); |
233 | 233 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $parts = explode(self::SERIALIZE_SEPARATOR, $serialized); |
250 | 250 | $list = array(); |
251 | 251 | |
252 | - foreach($parts as $part) |
|
252 | + foreach ($parts as $part) |
|
253 | 253 | { |
254 | 254 | $list[] = XMLHelper_DOMErrors_Error::fromSerialized($part); |
255 | 255 | } |
@@ -90,9 +90,9 @@ |
||
90 | 90 | */ |
91 | 91 | private static function checkErrorData(array $data) : void |
92 | 92 | { |
93 | - foreach(self::$requiredKeys as $key) |
|
93 | + foreach (self::$requiredKeys as $key) |
|
94 | 94 | { |
95 | - if(!array_key_exists($key, $data)) |
|
95 | + if (!array_key_exists($key, $data)) |
|
96 | 96 | { |
97 | 97 | throw new XMLHelper_Exception( |
98 | 98 | 'Required key missing in error data', |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | // error wrappers. |
84 | 84 | $errors = libxml_get_errors(); |
85 | 85 | |
86 | - foreach($errors as $error) |
|
86 | + foreach ($errors as $error) |
|
87 | 87 | { |
88 | 88 | $this->errors[] = new XMLHelper_SimpleXML_Error($this, $error); |
89 | 89 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $xml = $function($subject); |
99 | 99 | |
100 | - if($xml instanceof SimpleXMLElement) |
|
100 | + if ($xml instanceof SimpleXMLElement) |
|
101 | 101 | { |
102 | 102 | return $xml; |
103 | 103 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function getConverter() : XMLHelper_Converter |
109 | 109 | { |
110 | - if($this->element instanceof SimpleXMLElement) |
|
110 | + if ($this->element instanceof SimpleXMLElement) |
|
111 | 111 | { |
112 | 112 | return XMLHelper::convertElement($this->element); |
113 | 113 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public const ERROR_OPENING_ZIP_FILE = 338003; |
34 | 34 | |
35 | - public const ERROR_CANNOT_SAVE_FILE_TO_DISK =338004; |
|
35 | + public const ERROR_CANNOT_SAVE_FILE_TO_DISK = 338004; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @var array<string,mixed> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @see FileHelper::ERROR_SOURCE_FILE_DOES_NOT_EXIST |
87 | 87 | */ |
88 | - public function addFile(string $filePath, ?string $zipPath=null) : bool |
|
88 | + public function addFile(string $filePath, ?string $zipPath = null) : bool |
|
89 | 89 | { |
90 | 90 | $this->open(); |
91 | 91 | |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function open() : void |
140 | 140 | { |
141 | - if($this->open) { |
|
141 | + if ($this->open) { |
|
142 | 142 | return; |
143 | 143 | } |
144 | 144 | |
145 | - if(!isset($this->zip)) { |
|
145 | + if (!isset($this->zip)) { |
|
146 | 146 | $this->zip = new ZipArchive(); |
147 | 147 | } |
148 | 148 | |
149 | 149 | $flag = null; |
150 | - if(!file_exists($this->file)) { |
|
150 | + if (!file_exists($this->file)) { |
|
151 | 151 | $flag = ZipArchive::CREATE; |
152 | 152 | } |
153 | 153 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | { |
191 | 191 | $this->fileTracker++; |
192 | 192 | |
193 | - if($this->options['WriteThreshold'] < 1) { |
|
193 | + if ($this->options['WriteThreshold'] < 1) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | 196 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | protected function close() : void |
205 | 205 | { |
206 | - if(!$this->open) { |
|
206 | + if (!$this->open) { |
|
207 | 207 | return; |
208 | 208 | } |
209 | 209 | |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | throw new ZIPHelper_Exception( |
213 | 213 | 'Could not save ZIP file to disk', |
214 | 214 | sprintf( |
215 | - 'Tried saving the ZIP file [%1$s], but the write failed. This can have several causes, ' . |
|
216 | - 'including adding files that do not exist on disk, trying to create an empty zip, ' . |
|
215 | + 'Tried saving the ZIP file [%1$s], but the write failed. This can have several causes, '. |
|
216 | + 'including adding files that do not exist on disk, trying to create an empty zip, '. |
|
217 | 217 | 'or trying to save to a directory that does not exist.', |
218 | 218 | $this->file |
219 | 219 | ), |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | { |
229 | 229 | $this->open(); |
230 | 230 | |
231 | - if($this->countFiles() < 1) |
|
231 | + if ($this->countFiles() < 1) |
|
232 | 232 | { |
233 | 233 | throw new ZIPHelper_Exception( |
234 | 234 | 'No files in the zip file', |
@@ -254,18 +254,18 @@ discard block |
||
254 | 254 | * @throws ZIPHelper_Exception |
255 | 255 | * @return string The file name that was sent (useful in case none was specified). |
256 | 256 | */ |
257 | - public function download(?string $fileName=null) : string |
|
257 | + public function download(?string $fileName = null) : string |
|
258 | 258 | { |
259 | 259 | $this->save(); |
260 | 260 | |
261 | - if(empty($fileName)) |
|
261 | + if (empty($fileName)) |
|
262 | 262 | { |
263 | 263 | $fileName = basename($this->file); |
264 | 264 | } |
265 | 265 | |
266 | 266 | header('Content-type: application/zip'); |
267 | - header('Content-Disposition: attachment; filename=' . $fileName); |
|
268 | - header('Content-length: ' . filesize($this->file)); |
|
267 | + header('Content-Disposition: attachment; filename='.$fileName); |
|
268 | + header('Content-length: '.filesize($this->file)); |
|
269 | 269 | header('Pragma: no-cache'); |
270 | 270 | header('Expires: 0'); |
271 | 271 | readfile($this->file); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @throws ZIPHelper_Exception |
284 | 284 | * @see ZIPHelper::download() |
285 | 285 | */ |
286 | - public function downloadAndDelete(?string $fileName=null) : ZIPHelper |
|
286 | + public function downloadAndDelete(?string $fileName = null) : ZIPHelper |
|
287 | 287 | { |
288 | 288 | $this->download($fileName); |
289 | 289 | |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | * @param string|NULL $outputFolder If no folder is specified, uses the target file's folder. |
301 | 301 | * @return boolean |
302 | 302 | */ |
303 | - public function extractAll(?string $outputFolder=null) : bool |
|
303 | + public function extractAll(?string $outputFolder = null) : bool |
|
304 | 304 | { |
305 | - if(empty($outputFolder)) { |
|
305 | + if (empty($outputFolder)) { |
|
306 | 306 | $outputFolder = dirname($this->file); |
307 | 307 | } |
308 | 308 |
@@ -18,15 +18,15 @@ |
||
18 | 18 | * @param int $level |
19 | 19 | * @return array<mixed> |
20 | 20 | */ |
21 | - protected function traverseArray(array $array, int $level=0) : array |
|
21 | + protected function traverseArray(array $array, int $level = 0) : array |
|
22 | 22 | { |
23 | 23 | $result = array(); |
24 | 24 | |
25 | - foreach($array as $key => $val) |
|
25 | + foreach ($array as $key => $val) |
|
26 | 26 | { |
27 | - if(is_array($val)) |
|
27 | + if (is_array($val)) |
|
28 | 28 | { |
29 | - $result[$key] = $this->traverseArray($val, ($level+1)); |
|
29 | + $result[$key] = $this->traverseArray($val, ($level + 1)); |
|
30 | 30 | } |
31 | 31 | else |
32 | 32 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function getPresetsManager() : PresetsManager |
43 | 43 | { |
44 | - if(!isset(self::$presets)) |
|
44 | + if (!isset(self::$presets)) |
|
45 | 45 | { |
46 | 46 | self::$presets = new PresetsManager(); |
47 | 47 | } |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param string $name |
58 | 58 | * @return RGBAColor |
59 | 59 | */ |
60 | - public static function create(ColorChannel $red, ColorChannel $green, ColorChannel $blue, ?ColorChannel $alpha=null, string $name='') : RGBAColor |
|
60 | + public static function create(ColorChannel $red, ColorChannel $green, ColorChannel $blue, ?ColorChannel $alpha = null, string $name = '') : RGBAColor |
|
61 | 61 | { |
62 | - if($alpha === null) |
|
62 | + if ($alpha === null) |
|
63 | 63 | { |
64 | 64 | $alpha = ColorChannel::eightBit(0); |
65 | 65 | } |
@@ -86,31 +86,31 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function createAuto($subject) : ?RGBAColor |
88 | 88 | { |
89 | - if($subject instanceof RGBAColor) |
|
89 | + if ($subject instanceof RGBAColor) |
|
90 | 90 | { |
91 | 91 | return $subject; |
92 | 92 | } |
93 | 93 | |
94 | - if(is_array($subject)) |
|
94 | + if (is_array($subject)) |
|
95 | 95 | { |
96 | 96 | return self::createFrom8BitArray($subject); |
97 | 97 | } |
98 | 98 | |
99 | 99 | $hexOrPreset = (string)$subject; |
100 | 100 | |
101 | - if($hexOrPreset === '') |
|
101 | + if ($hexOrPreset === '') |
|
102 | 102 | { |
103 | 103 | return null; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $manager = self::getPresetsManager(); |
107 | 107 | |
108 | - if($manager->hasPreset($hexOrPreset)) |
|
108 | + if ($manager->hasPreset($hexOrPreset)) |
|
109 | 109 | { |
110 | 110 | return $manager->getPreset($hexOrPreset); |
111 | 111 | } |
112 | 112 | |
113 | - if(preg_match('/[a-f0-9]{3,8}/i', $hexOrPreset)) |
|
113 | + if (preg_match('/[a-f0-9]{3,8}/i', $hexOrPreset)) |
|
114 | 114 | { |
115 | 115 | return self::createFromHEX($hexOrPreset); |
116 | 116 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | { |
159 | 159 | $color = FormatsConverter::array2associative($color); |
160 | 160 | |
161 | - if(!isset($color[RGBAColor::CHANNEL_ALPHA])) |
|
161 | + if (!isset($color[RGBAColor::CHANNEL_ALPHA])) |
|
162 | 162 | { |
163 | 163 | $color[RGBAColor::CHANNEL_ALPHA] = 0; |
164 | 164 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @see RGBAColor::ERROR_INVALID_COLOR_COMPONENT |
184 | 184 | * @see RGBAColor::ERROR_INVALID_PERCENTAGE_VALUE |
185 | 185 | */ |
186 | - public static function createFromHEX(string $hex, string $name='') : RGBAColor |
|
186 | + public static function createFromHEX(string $hex, string $name = '') : RGBAColor |
|
187 | 187 | { |
188 | 188 | return FormatsConverter::hex2color($hex, $name); |
189 | 189 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @param string $name |
209 | 209 | * @return RGBAColor |
210 | 210 | */ |
211 | - public static function createPercent(float $red, float $green, float $blue, float $alpha=0, string $name='') : RGBAColor |
|
211 | + public static function createPercent(float $red, float $green, float $blue, float $alpha = 0, string $name = '') : RGBAColor |
|
212 | 212 | { |
213 | 213 | return new RGBAColor( |
214 | 214 | ColorChannel::percent($red), |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param string $name |
231 | 231 | * @return RGBAColor |
232 | 232 | */ |
233 | - public static function createCSS(int $red, int $green, int $blue, float $alpha=0, string $name='') : RGBAColor |
|
233 | + public static function createCSS(int $red, int $green, int $blue, float $alpha = 0, string $name = '') : RGBAColor |
|
234 | 234 | { |
235 | 235 | return self::create( |
236 | 236 | ColorChannel::eightBit($red), |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @param string $name |
253 | 253 | * @return RGBAColor |
254 | 254 | */ |
255 | - public static function create8Bit(int $red, int $green, int $blue, int $alpha=0, string $name='') : RGBAColor |
|
255 | + public static function create8Bit(int $red, int $green, int $blue, int $alpha = 0, string $name = '') : RGBAColor |
|
256 | 256 | { |
257 | 257 | return self::create( |
258 | 258 | ColorChannel::eightBit($red), |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * @param string $name |
276 | 276 | * @return RGBAColor |
277 | 277 | */ |
278 | - public static function createGD(int $red, int $green, int $blue, int $alpha=0, string $name='') : RGBAColor |
|
278 | + public static function createGD(int $red, int $green, int $blue, int $alpha = 0, string $name = '') : RGBAColor |
|
279 | 279 | { |
280 | 280 | return self::create( |
281 | 281 | ColorChannel::eightBit($red), |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $color = imagecolorsforindex($img, $colorIndex); |
298 | 298 | |
299 | 299 | // it seems imagecolorsforindex() may return false (undocumented, unproven) |
300 | - if(is_array($color)) { |
|
300 | + if (is_array($color)) { |
|
301 | 301 | return self::create( |
302 | 302 | ColorChannel::eightBit($color['red']), |
303 | 303 | ColorChannel::eightBit($color['green']), |