Passed
Push — master ( bba89e...9d3a5c )
by Sebastian
09:03
created
src/ImageHelper/ImageTrimmer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param RGBAColor|null $trimColor
38 38
      * @throws ImageHelper_Exception
39 39
      */
40
-    public function __construct(ImageHelper $helper, $sourceImage, ?RGBAColor $trimColor=null)
40
+    public function __construct(ImageHelper $helper, $sourceImage, ?RGBAColor $trimColor = null)
41 41
     {
42 42
         ImageHelper::requireResource($sourceImage);
43 43
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $targetColor = ColorFactory::createAuto($trimColor);
52 52
 
53
-        if($targetColor !== null)
53
+        if ($targetColor !== null)
54 54
         {
55 55
             return $targetColor;
56 56
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             )
80 80
         );
81 81
 
82
-        if($img !== false) {
82
+        if ($img !== false) {
83 83
             return $img;
84 84
         }
85 85
 
@@ -99,16 +99,16 @@  discard block
 block discarded – undo
99 99
         $ymax = null;
100 100
 
101 101
         // Start scanning for the edges.
102
-        for ($iy=0; $iy<$imh; $iy++)
102
+        for ($iy = 0; $iy < $imh; $iy++)
103 103
         {
104 104
             $first = true;
105 105
 
106
-            for ($ix=0; $ix<$imw; $ix++)
106
+            for ($ix = 0; $ix < $imw; $ix++)
107 107
             {
108 108
                 $ndx = imagecolorat($this->sourceImage, $ix, $iy);
109 109
                 $colors = $this->helper->getIndexedColors($this->sourceImage, $ndx);
110 110
 
111
-                if(!$colors->matchesAlpha($this->trimColor))
111
+                if (!$colors->matchesAlpha($this->trimColor))
112 112
                 {
113 113
                     if ($xmin > $ix) { $xmin = $ix; }
114 114
                     if ($xmax < $ix) { $xmax = $ix; }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
                     $ymax = $iy;
118 118
 
119
-                    if($first)
119
+                    if ($first)
120 120
                     {
121 121
                         $ix = $xmax;
122 122
                         $first = false;
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
         }
127 127
 
128 128
         // no trimming border found
129
-        if($ymax === null) {
129
+        if ($ymax === null) {
130 130
             return $this->sourceImage;
131 131
         }
132 132
 
133 133
         // The new width and height of the image.
134
-        $imw = 1+$xmax-$xmin; // Image width in pixels
135
-        $imh = 1+$ymax-$ymin; // Image height in pixels
134
+        $imw = 1 + $xmax - $xmin; // Image width in pixels
135
+        $imh = 1 + $ymax - $ymin; // Image height in pixels
136 136
 
137 137
         // Make another image to place the trimmed version in.
138 138
         $im2 = $this->helper->createNewImage($imw, $imh);
139 139
 
140
-        if($this->trimColor->hasTransparency())
140
+        if ($this->trimColor->hasTransparency())
141 141
         {
142 142
             $bg2 = imagecolorallocatealpha(
143 143
                 $im2,
Please login to merge, or discard this patch.
src/AttributeCollection.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function setAttributes(array $attributes) : AttributeCollection
79 79
     {
80
-        foreach($attributes as $name => $value)
80
+        foreach ($attributes as $name => $value)
81 81
         {
82 82
             $this->attr($name, $value);
83 83
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         return $this;
86 86
     }
87 87
 
88
-    public function getAttribute(string $name, string $default='') : string
88
+    public function getAttribute(string $name, string $default = '') : string
89 89
     {
90 90
         return $this->attributes[$name] ?? $default;
91 91
     }
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
      * @param array<string,string|number|bool|NULL|Interface_Stringable|StringBuilder_Interface> $attributes
95 95
      * @return AttributeCollection
96 96
      */
97
-    public static function create(array $attributes=array()) : AttributeCollection
97
+    public static function create(array $attributes = array()) : AttributeCollection
98 98
     {
99 99
         return new AttributeCollection($attributes);
100 100
     }
101 101
 
102
-    public function prop(string $name, bool $enabled=true) : AttributeCollection
102
+    public function prop(string $name, bool $enabled = true) : AttributeCollection
103 103
     {
104
-        if($enabled)
104
+        if ($enabled)
105 105
         {
106 106
             return $this->attr($name, $name);
107 107
         }
@@ -118,23 +118,23 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $string = Filtering::value2string($value);
120 120
 
121
-        if($name === 'class')
121
+        if ($name === 'class')
122 122
         {
123 123
             return $this->addClasses(ConvertHelper::explodeTrim(' ', $string));
124 124
         }
125 125
 
126
-        if($name === 'style')
126
+        if ($name === 'style')
127 127
         {
128 128
             $this->styles->parseStylesString($string);
129 129
             return $this;
130 130
         }
131 131
 
132
-        if($string !== '')
132
+        if ($string !== '')
133 133
         {
134 134
             $this->attributes[$name] = $string;
135 135
 
136 136
             // remove it from the empty stack if it was empty before.
137
-            if(in_array($name, $this->empty, true)) {
137
+            if (in_array($name, $this->empty, true)) {
138 138
                 $this->empty = array_remove_values($this->empty, array($name));
139 139
             }
140 140
         }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     {
160 160
         $this->attr($name, $value);
161 161
 
162
-        if(isset($this->attributes[$name]))
162
+        if (isset($this->attributes[$name]))
163 163
         {
164 164
             $this->attributes[$name] = Filtering::quotes($this->attributes[$name]);
165 165
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     public function remove(string $name) : AttributeCollection
176 176
     {
177
-        if(isset($this->attributes[$name]))
177
+        if (isset($this->attributes[$name]))
178 178
         {
179 179
             unset($this->attributes[$name]);
180 180
         }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
     private function getRenderer() : AttributesRenderer
198 198
     {
199
-        if(isset($this->renderer))
199
+        if (isset($this->renderer))
200 200
         {
201 201
             return $this->renderer;
202 202
         }
@@ -230,12 +230,12 @@  discard block
 block discarded – undo
230 230
         $attributes = $this->attributes;
231 231
 
232 232
         // Are there any empty attributes to keep?
233
-        if(!empty($this->keepEmpty))
233
+        if (!empty($this->keepEmpty))
234 234
         {
235 235
             $names = array_keys($this->keepEmpty);
236 236
 
237
-            foreach($names as $name) {
238
-                if(in_array($name, $this->empty, true)) {
237
+            foreach ($names as $name) {
238
+                if (in_array($name, $this->empty, true)) {
239 239
                     $attributes[$name] = '';
240 240
                 }
241 241
             }
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
         return $attributes;
245 245
     }
246 246
 
247
-    public function setKeepIfEmpty(string $name, bool $keep=true) : self
247
+    public function setKeepIfEmpty(string $name, bool $keep = true) : self
248 248
     {
249
-        if($keep === true)
249
+        if ($keep === true)
250 250
         {
251 251
             $this->keepEmpty[$name] = true;
252 252
         }
253
-        else if(isset($this->keepEmpty[$name]))
253
+        else if (isset($this->keepEmpty[$name]))
254 254
         {
255 255
             unset($this->keepEmpty[$name]);
256 256
         }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
     public const TARGET_BLANK = '_blank';
301 301
 
302
-    public function target(string $value=self::TARGET_BLANK) : AttributeCollection
302
+    public function target(string $value = self::TARGET_BLANK) : AttributeCollection
303 303
     {
304 304
         return $this->attr('target', $value);
305 305
     }
Please login to merge, or discard this patch.
src/HTMLTag.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @param bool $selfClosing
55 55
      * @return $this
56 56
      */
57
-    public function setSelfClosing(bool $selfClosing=true) : self
57
+    public function setSelfClosing(bool $selfClosing = true) : self
58 58
     {
59 59
         $this->selfClosing = $selfClosing;
60 60
         return $this;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param bool $allowed
70 70
      * @return $this
71 71
      */
72
-    public function setEmptyAllowed(bool $allowed=true) : self
72
+    public function setEmptyAllowed(bool $allowed = true) : self
73 73
     {
74 74
         $this->allowEmpty = $allowed;
75 75
         return $this;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function isEmptyAllowed() : bool
79 79
     {
80
-        if($this->isSelfClosing())
80
+        if ($this->isSelfClosing())
81 81
         {
82 82
             return true;
83 83
         }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
         return $this->allowEmpty;
86 86
     }
87 87
 
88
-    public static function create(string $name, ?AttributeCollection $attributes=null) : HTMLTag
88
+    public static function create(string $name, ?AttributeCollection $attributes = null) : HTMLTag
89 89
     {
90
-        if($attributes === null)
90
+        if ($attributes === null)
91 91
         {
92 92
             $attributes = AttributeCollection::create();
93 93
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     public function render() : string
115 115
     {
116
-        if(!$this->isEmptyAllowed() && $this->isEmpty())
116
+        if (!$this->isEmptyAllowed() && $this->isEmpty())
117 117
         {
118 118
             return '';
119 119
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     public static function getGlobalOptions() : GlobalOptions
128 128
     {
129
-        if(!isset(self::$globalOptions))
129
+        if (!isset(self::$globalOptions))
130 130
         {
131 131
             self::$globalOptions = new GlobalOptions();
132 132
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     public function getSelfClosingChar() : string
138 138
     {
139
-        if($this->selfClosing && self::getGlobalOptions()->getSelfCloseStyle() === self::SELF_CLOSE_STYLE_SLASH)
139
+        if ($this->selfClosing && self::getGlobalOptions()->getSelfCloseStyle() === self::SELF_CLOSE_STYLE_SLASH)
140 140
         {
141 141
             return '/';
142 142
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
     public function renderClose() : string
158 158
     {
159
-        if($this->selfClosing)
159
+        if ($this->selfClosing)
160 160
         {
161 161
             return '';
162 162
         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
     public function renderContent() : string
202 202
     {
203
-        if($this->selfClosing)
203
+        if ($this->selfClosing)
204 204
         {
205 205
             return '';
206 206
         }
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
      * @param bool $keepIfEmpty
220 220
      * @return $this
221 221
      */
222
-    public function attr(string $name, string $value, bool $keepIfEmpty=false) : self
222
+    public function attr(string $name, string $value, bool $keepIfEmpty = false) : self
223 223
     {
224 224
         $this->attributes->attr($name, $value);
225 225
 
226
-        if($keepIfEmpty) {
226
+        if ($keepIfEmpty) {
227 227
             $this->attributes->setKeepIfEmpty($name);
228 228
         }
229 229
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      * @param bool $enabled
236 236
      * @return $this
237 237
      */
238
-    public function prop(string $name, bool $enabled=true) : self
238
+    public function prop(string $name, bool $enabled = true) : self
239 239
     {
240 240
         $this->attributes->prop($name, $enabled);
241 241
         return $this;
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
  * @param bool $forceNew
13 13
  * @return NumberInfo
14 14
  */
15
-function parseNumber($value, bool $forceNew=false)
15
+function parseNumber($value, bool $forceNew = false)
16 16
 {
17
-    if($value instanceof NumberInfo && $forceNew !== true) {
17
+    if ($value instanceof NumberInfo && $forceNew !== true) {
18 18
         return $value;
19 19
     }
20 20
     
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     $args = func_get_args();
110 110
     
111 111
     // is the localization package installed?
112
-    if(function_exists('\AppLocalize\t'))
112
+    if (function_exists('\AppLocalize\t'))
113 113
     {
114 114
         return call_user_func_array('\AppLocalize\t', $args);
115 115
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @param bool $initial The initial boolean value to use.
125 125
  * @return Value_Bool
126 126
  */
127
-function valBool(bool $initial=false) : Value_Bool
127
+function valBool(bool $initial = false) : Value_Bool
128 128
 {
129 129
     return new Value_Bool($initial);
130 130
 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  * @param bool $initial
138 138
  * @return Value_Bool_True
139 139
  */
140
-function valBoolTrue(bool $initial=false) : Value_Bool_True
140
+function valBoolTrue(bool $initial = false) : Value_Bool_True
141 141
 {
142 142
     return new Value_Bool_True($initial);
143 143
 }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
  * @param bool $initial
151 151
  * @return Value_Bool_False
152 152
  */
153
-function valBoolFalse(bool $initial=true) : Value_Bool_False
153
+function valBoolFalse(bool $initial = true) : Value_Bool_False
154 154
 {
155 155
     return new Value_Bool_False($initial);
156 156
 }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
  * @param bool $strict
183 183
  * @return array<mixed>
184 184
  */
185
-function array_remove_values(array $haystack, array $values, bool $strict=true) : array
185
+function array_remove_values(array $haystack, array $values, bool $strict = true) : array
186 186
 {
187 187
     return array_filter(
188 188
         $haystack,
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
  */
198 198
 function init() : void
199 199
 {
200
-    if(!class_exists('\AppLocalize\Localization')) {
200
+    if (!class_exists('\AppLocalize\Localization')) {
201 201
         return;
202 202
     }
203 203
     
Please login to merge, or discard this patch.
src/AttributeCollection/AttributesRenderer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 
25 25
         $attributes = $this->compileAttributes();
26 26
 
27
-        if(empty($attributes))
27
+        if (empty($attributes))
28 28
         {
29 29
             return '';
30 30
         }
31 31
 
32
-        foreach($attributes as $name => $value)
32
+        foreach ($attributes as $name => $value)
33 33
         {
34
-            if($value === '' && !$this->collection->isKeepIfEmpty($name))
34
+            if ($value === '' && !$this->collection->isKeepIfEmpty($name))
35 35
             {
36 36
                 continue;
37 37
             }
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $attributes = $this->collection->getRawAttributes();
55 55
 
56
-        if($this->collection->hasClasses())
56
+        if ($this->collection->hasClasses())
57 57
         {
58 58
             $attributes['class'] = $this->collection->classesToString();
59 59
         }
60 60
 
61
-        if($this->collection->hasStyles())
61
+        if ($this->collection->hasStyles())
62 62
         {
63 63
             $attributes['style'] = $this->collection->getStyles()
64 64
                 ->configureForInline()
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     private function renderAttribute(string $name, string $value) : string
72 72
     {
73
-        if($name === $value)
73
+        if ($name === $value)
74 74
         {
75 75
             return $name;
76 76
         }
Please login to merge, or discard this patch.
src/Microtime/ParseResult.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function __construct(string $datetime, DateTimeZone $timeZone)
42 42
     {
43
-        if(stripos($datetime, 'T') !== false) {
43
+        if (stripos($datetime, 'T') !== false) {
44 44
             $datetime = $this->parseISO8601($datetime);
45 45
         }
46 46
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         preg_match('/([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2})\.([0-9]+)Z/', $datetime, $matches);
54 54
 
55
-        if(!empty($matches[0])) {
55
+        if (!empty($matches[0])) {
56 56
             return sprintf(
57 57
                 '%s %s.%s',
58 58
                 $matches[1],
Please login to merge, or discard this patch.
src/Microtime.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
      * @see Microtime::createFromString()
52 52
      * @see Microtime::createNow()
53 53
      */
54
-    public function __construct($datetime=self::DATETIME_NOW, ?DateTimeZone $timeZone=null)
54
+    public function __construct($datetime = self::DATETIME_NOW, ?DateTimeZone $timeZone = null)
55 55
     {
56
-        if($datetime instanceof Microtime_ParseResult)
56
+        if ($datetime instanceof Microtime_ParseResult)
57 57
         {
58 58
             $parsed = $datetime;
59 59
         }
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      * @return Microtime_ParseResult
87 87
      * @throws Microtime_Exception
88 88
      */
89
-    private function parseDate($datetime, ?DateTimeZone $timeZone=null) : Microtime_ParseResult
89
+    private function parseDate($datetime, ?DateTimeZone $timeZone = null) : Microtime_ParseResult
90 90
     {
91
-        if($datetime instanceof self)
91
+        if ($datetime instanceof self)
92 92
         {
93 93
             return new Microtime_ParseResult(
94 94
                 $datetime->getISODate(),
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             );
97 97
         }
98 98
 
99
-        if($datetime instanceof DateTime)
99
+        if ($datetime instanceof DateTime)
100 100
         {
101 101
             return new Microtime_ParseResult(
102 102
                 $datetime->format(self::FORMAT_ISO),
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
             );
105 105
         }
106 106
 
107
-        if($timeZone === null)
107
+        if ($timeZone === null)
108 108
         {
109 109
             $timeZone = new DateTimeZone(date_default_timezone_get());
110 110
         }
111 111
 
112
-        if(empty($datetime) || $datetime === self::DATETIME_NOW)
112
+        if (empty($datetime) || $datetime === self::DATETIME_NOW)
113 113
         {
114 114
             return self::parseNow($timeZone);
115 115
         }
116 116
 
117
-        if(is_string($datetime))
117
+        if (is_string($datetime))
118 118
         {
119 119
             return new Microtime_ParseResult(
120 120
                 $datetime,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     {
142 142
         $dateObj = DateTime::createFromFormat('0.u00 U', microtime(), new DateTimeZone('America/Denver'));
143 143
 
144
-        if($dateObj !== false)
144
+        if ($dateObj !== false)
145 145
         {
146 146
             $dateObj->setTimezone($timeZone);
147 147
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
      * @return Microtime
166 166
      * @throws Microtime_Exception
167 167
      */
168
-    public static function createNow(?DateTimeZone $timeZone=null) : Microtime
168
+    public static function createNow(?DateTimeZone $timeZone = null) : Microtime
169 169
     {
170
-        if($timeZone === null)
170
+        if ($timeZone === null)
171 171
         {
172 172
             $timeZone = new DateTimeZone(date_default_timezone_get());
173 173
         }
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
      * @return Microtime
185 185
      * @throws Microtime_Exception
186 186
      */
187
-    public static function createFromString(string $date, ?DateTimeZone $timeZone=null) : Microtime
187
+    public static function createFromString(string $date, ?DateTimeZone $timeZone = null) : Microtime
188 188
     {
189
-        if($timeZone === null)
189
+        if ($timeZone === null)
190 190
         {
191 191
             $timeZone = new DateTimeZone(date_default_timezone_get());
192 192
         }
Please login to merge, or discard this patch.
src/URLInfo/URIParser.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
         $result = parse_url($this->url);
111 111
         $this->info = array();
112 112
 
113
-        if(!is_array($result))
113
+        if (!is_array($result))
114 114
         {
115 115
             $this->fixBrokenURL();
116 116
             $result = parse_url($this->url);
117 117
         }
118 118
 
119
-        if(is_array($result))
119
+        if (is_array($result))
120 120
         {
121 121
             $this->info = $result;
122 122
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         // if the URL contains any URL characters, and we
127 127
         // do not want them URL encoded, restore them.
128
-        if(!$this->encodeUTF && !empty($this->unicodeChars))
128
+        if (!$this->encodeUTF && !empty($this->unicodeChars))
129 129
         {
130 130
             $this->info = $this->restoreUnicodeChars($this->info);
131 131
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     private function fixBrokenURL() : void
139 139
     {
140
-        if(strpos($this->url, ':') === false) {
140
+        if (strpos($this->url, ':') === false) {
141 141
             return;
142 142
         }
143 143
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         // else, as unlikely as it may be.
146 146
         $parts = explode(':', $this->url);
147 147
 
148
-        while(strpos($parts[1], '///') === 0)
148
+        while (strpos($parts[1], '///') === 0)
149 149
         {
150 150
             $parts[1] = str_replace('///', '//', $parts[1]);
151 151
         }
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
         
165 165
         $keep = array();
166 166
         
167
-        foreach($chars as $char)
167
+        foreach ($chars as $char)
168 168
         {
169
-            if(preg_match('/\p{L}/uix', $char))
169
+            if (preg_match('/\p{L}/uix', $char))
170 170
             {
171 171
                 $encoded = rawurlencode($char);
172 172
                 
173
-                if($encoded !== $char)
173
+                if ($encoded !== $char)
174 174
                 {
175 175
                     $this->unicodeChars[$encoded] = $char;
176 176
                     $char = $encoded;
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
     protected function detectType() : bool
187 187
     {
188
-        foreach(self::$detectorClasses as $className)
188
+        foreach (self::$detectorClasses as $className)
189 189
         {
190 190
             $detector = ClassHelper::requireObjectInstanceOf(
191 191
                 BaseURLTypeDetector::class,
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             // Use the adjusted data
198 198
             $this->info = $detector->getInfo();
199 199
 
200
-            if($detected) {
200
+            if ($detected) {
201 201
                 $this->isValid = true;
202 202
                 return true;
203 203
             }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
     protected function validate() : void
210 210
     {
211
-        foreach(self::$validatorClasses as $validatorClass)
211
+        foreach (self::$validatorClasses as $validatorClass)
212 212
         {
213 213
             $validator = ClassHelper::requireObjectInstanceOf(
214 214
                 BaseURLValidator::class,
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
             $this->info = $validator->getInfo();
221 221
 
222
-            if($result !== true) {
222
+            if ($result !== true) {
223 223
                 $this->isValid = false;
224 224
                 return;
225 225
             }
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
     {
250 250
         $result = array();
251 251
         
252
-        foreach($subject as $key => $val)
252
+        foreach ($subject as $key => $val)
253 253
         {
254
-            if(is_array($val))
254
+            if (is_array($val))
255 255
             {
256 256
                 $val = $this->restoreUnicodeChars($val);
257 257
             }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     */
278 278
     protected function restoreUnicodeChar(string $string) : string
279 279
     {
280
-        if(strpos($string, '%') !== false)
280
+        if (strpos($string, '%') !== false)
281 281
         {
282 282
             return str_replace(array_keys($this->unicodeChars), array_values($this->unicodeChars), $string);
283 283
         }
Please login to merge, or discard this patch.
src/URLInfo/Parser/ParsedInfoFilter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $path = $this->info['path'] ?? '';
58 58
 
59
-        if(strpos($path, '@') !== false)
59
+        if (strpos($path, '@') !== false)
60 60
         {
61 61
             $this->info['path'] = str_replace(' ', '', $path);
62 62
         }
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function filterScheme() : void
66 66
     {
67
-        if($this->hasScheme())
67
+        if ($this->hasScheme())
68 68
         {
69 69
             $this->setScheme(strtolower($this->getScheme()));
70 70
         }
71 71
         else
72 72
         {
73 73
             $scheme = URISchemes::detectScheme($this->url);
74
-            if(!empty($scheme)) {
74
+            if (!empty($scheme)) {
75 75
                 $this->setScheme(URISchemes::resolveSchemeName($scheme));
76 76
             }
77 77
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     private function filterAuth() : void
81 81
     {
82
-        if(!$this->hasAuth()) {
82
+        if (!$this->hasAuth()) {
83 83
             return;
84 84
         }
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
     private function filterHost() : void
93 93
     {
94
-        if(!$this->hasHost())
94
+        if (!$this->hasHost())
95 95
         {
96 96
             return;
97 97
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     private function filterPath() : void
106 106
     {
107
-        if($this->hasPath()) {
107
+        if ($this->hasPath()) {
108 108
             $this->setPath($this->getPath());
109 109
         }
110 110
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $host = $this->getPath();
115 115
 
116
-        if(empty($host) || !URLHosts::isHostKnown($host))
116
+        if (empty($host) || !URLHosts::isHostKnown($host))
117 117
         {
118 118
             return;
119 119
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $this->setHost($host);
122 122
         $this->removePath();
123 123
 
124
-        if(!$this->hasScheme()) {
124
+        if (!$this->hasScheme()) {
125 125
             $this->setSchemeHTTPS();
126 126
         }
127 127
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $this->info['params'] = array();
132 132
 
133 133
         $query = $this->getQuery();
134
-        if(empty($query)) {
134
+        if (empty($query)) {
135 135
             return;
136 136
         }
137 137
 
Please login to merge, or discard this patch.