Passed
Push — master ( 2508f8...8e3f03 )
by Sebastian
02:23
created
src/Traits/Optionable.php 2 patches
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
  */
27 27
 trait Traits_Optionable
28 28
 {
29
-   /**
30
-    * @var array
31
-    */
29
+    /**
30
+     * @var array
31
+     */
32 32
     protected $options;
33 33
     
34
-   /**
35
-    * Sets an option to the specified value. This can be any
36
-    * kind of variable type, including objects, as needed.
37
-    * 
38
-    * @param string $name
39
-    * @param mixed $value
40
-    */
34
+    /**
35
+     * Sets an option to the specified value. This can be any
36
+     * kind of variable type, including objects, as needed.
37
+     * 
38
+     * @param string $name
39
+     * @param mixed $value
40
+     */
41 41
     public function setOption(string $name, $value)
42 42
     {
43 43
         if(!isset($this->options)) {
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
         return $this;
49 49
     }
50 50
     
51
-   /**
52
-    * Sets a collection of options at once, from an
53
-    * associative array.
54
-    * 
55
-    * @param array $options
56
-    */
51
+    /**
52
+     * Sets a collection of options at once, from an
53
+     * associative array.
54
+     * 
55
+     * @param array $options
56
+     */
57 57
     public function setOptions(array $options)
58 58
     {
59 59
         foreach($options as $name => $value) {
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
         return $this;
64 64
     }
65 65
     
66
-   /**
67
-    * Retrieves an option's value.
68
-    * 
69
-    * NOTE: Use the specialized type getters to ensure an option
70
-    * contains the expected type (for ex. getArrayOption()). 
71
-    * 
72
-    * @param string $name
73
-    * @param mixed $default The default value to return if the option does not exist.
74
-    * @return mixed
75
-    */
66
+    /**
67
+     * Retrieves an option's value.
68
+     * 
69
+     * NOTE: Use the specialized type getters to ensure an option
70
+     * contains the expected type (for ex. getArrayOption()). 
71
+     * 
72
+     * @param string $name
73
+     * @param mixed $default The default value to return if the option does not exist.
74
+     * @return mixed
75
+     */
76 76
     public function getOption(string $name, $default=null)
77 77
     {
78 78
         if(!isset($this->options)) {
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
         return $default;
87 87
     }
88 88
     
89
-   /**
90
-    * Enforces that the option value is a string. Numbers are converted
91
-    * to string, strings are passed through, and all other types will 
92
-    * return the default value. The default value is also returned if
93
-    * the string is empty.
94
-    * 
95
-    * @param string $name
96
-    * @param string $default Used if the option does not exist, is invalid, or empty.
97
-    * @return string
98
-    */
89
+    /**
90
+     * Enforces that the option value is a string. Numbers are converted
91
+     * to string, strings are passed through, and all other types will 
92
+     * return the default value. The default value is also returned if
93
+     * the string is empty.
94
+     * 
95
+     * @param string $name
96
+     * @param string $default Used if the option does not exist, is invalid, or empty.
97
+     * @return string
98
+     */
99 99
     public function getStringOption(string $name, string $default='') : string
100 100
     {
101 101
         $value = $this->getOption($name, false);
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
         return $default;
108 108
     }
109 109
     
110
-   /**
111
-    * Treats the option value as a boolean value: will return
112
-    * true if the value actually is a boolean true.
113
-    * 
114
-    * NOTE: boolean string representations are not accepted.
115
-    * 
116
-    * @param string $name
117
-    * @return bool
118
-    */
110
+    /**
111
+     * Treats the option value as a boolean value: will return
112
+     * true if the value actually is a boolean true.
113
+     * 
114
+     * NOTE: boolean string representations are not accepted.
115
+     * 
116
+     * @param string $name
117
+     * @return bool
118
+     */
119 119
     public function getBoolOption(string $name, bool $default=false) : bool
120 120
     {
121 121
         if($this->getOption($name) === true) {
@@ -125,15 +125,15 @@  discard block
 block discarded – undo
125 125
         return $default;
126 126
     }
127 127
     
128
-   /**
129
-    * Treats the option value as an integer value: will return
130
-    * valid integer values (also from integer strings), or the
131
-    * default value otherwise.
132
-    * 
133
-    * @param string $name
134
-    * @param int $default
135
-    * @return int
136
-    */
128
+    /**
129
+     * Treats the option value as an integer value: will return
130
+     * valid integer values (also from integer strings), or the
131
+     * default value otherwise.
132
+     * 
133
+     * @param string $name
134
+     * @param int $default
135
+     * @return int
136
+     */
137 137
     public function getIntOption(string $name, int $default=0) : int
138 138
     {
139 139
         $value = $this->getOption($name);
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
         return $default;
145 145
     }
146 146
     
147
-   /**
148
-    * Treats an option as an array, and returns its value
149
-    * only if it contains an array - otherwise, an empty
150
-    * array is returned.
151
-    * 
152
-    * @param string $name
153
-    * @return array
154
-    */
147
+    /**
148
+     * Treats an option as an array, and returns its value
149
+     * only if it contains an array - otherwise, an empty
150
+     * array is returned.
151
+     * 
152
+     * @param string $name
153
+     * @return array
154
+     */
155 155
     public function getArrayOption(string $name) : array
156 156
     {
157 157
         $val = $this->getOption($name);
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
         return array();
163 163
     }
164 164
     
165
-   /**
166
-    * Checks whether the specified option exists - even
167
-    * if it has a NULL value.
168
-    * 
169
-    * @param string $name
170
-    * @return bool
171
-    */
165
+    /**
166
+     * Checks whether the specified option exists - even
167
+     * if it has a NULL value.
168
+     * 
169
+     * @param string $name
170
+     * @return bool
171
+     */
172 172
     public function hasOption(string $name) : bool
173 173
     {
174 174
         if(!isset($this->options)) {
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
         return array_key_exists($name, $this->options);
179 179
     }
180 180
     
181
-   /**
182
-    * Returns all options in one associative array.
183
-    * @return array
184
-    */
181
+    /**
182
+     * Returns all options in one associative array.
183
+     * @return array
184
+     */
185 185
     public function getOptions() : array
186 186
     {
187 187
         if(!isset($this->options)) {
@@ -191,24 +191,24 @@  discard block
 block discarded – undo
191 191
         return $this->options;
192 192
     }
193 193
     
194
-   /**
195
-    * Checks whether the option's value is the one specified.
196
-    * 
197
-    * @param string $name
198
-    * @param mixed $value
199
-    * @return bool
200
-    */
194
+    /**
195
+     * Checks whether the option's value is the one specified.
196
+     * 
197
+     * @param string $name
198
+     * @param mixed $value
199
+     * @return bool
200
+     */
201 201
     public function isOption(string $name, $value) : bool
202 202
     {
203 203
         return $this->getOption($name) === $value;
204 204
     }
205 205
     
206
-   /**
207
-    * Retrieves the default available options as an 
208
-    * associative array with option name => value pairs.
209
-    * 
210
-    * @return array
211
-    */
206
+    /**
207
+     * Retrieves the default available options as an 
208
+     * associative array with option name => value pairs.
209
+     * 
210
+     * @return array
211
+     */
212 212
     abstract public function getDefaultOptions() : array;
213 213
 }
214 214
 
@@ -226,24 +226,24 @@  discard block
 block discarded – undo
226 226
  */
227 227
 interface Interface_Optionable
228 228
 {
229
-   /**
230
-    * @param string $name
231
-    * @param mixed $value
232
-    * @return $this
233
-    */
229
+    /**
230
+     * @param string $name
231
+     * @param mixed $value
232
+     * @return $this
233
+     */
234 234
     function setOption(string $name, $value);
235 235
     
236
-   /**
237
-    * @param string $name
238
-    * @param mixed $default
239
-    * @return $this
240
-    */
236
+    /**
237
+     * @param string $name
238
+     * @param mixed $default
239
+     * @return $this
240
+     */
241 241
     function getOption(string $name, $default=null);
242 242
     
243
-   /**
244
-    * @param array $options
245
-    * @return $this    
246
-    */
243
+    /**
244
+     * @param array $options
245
+     * @return $this    
246
+     */
247 247
     function setOptions(array $options);
248 248
     function getOptions() : array;
249 249
     function isOption(string $name, $value) : bool;
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     */
41 41
     public function setOption(string $name, $value)
42 42
     {
43
-        if(!isset($this->options)) {
43
+        if (!isset($this->options)) {
44 44
             $this->options = $this->getDefaultOptions();
45 45
         }
46 46
         
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     */
57 57
     public function setOptions(array $options)
58 58
     {
59
-        foreach($options as $name => $value) {
59
+        foreach ($options as $name => $value) {
60 60
             $this->setOption($name, $value);
61 61
         }
62 62
         
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
     * @param mixed $default The default value to return if the option does not exist.
74 74
     * @return mixed
75 75
     */
76
-    public function getOption(string $name, $default=null)
76
+    public function getOption(string $name, $default = null)
77 77
     {
78
-        if(!isset($this->options)) {
78
+        if (!isset($this->options)) {
79 79
             $this->options = $this->getDefaultOptions();
80 80
         }
81 81
         
82
-        if(isset($this->options[$name])) {
82
+        if (isset($this->options[$name])) {
83 83
             return $this->options[$name];
84 84
         }
85 85
         
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
     * @param string $default Used if the option does not exist, is invalid, or empty.
97 97
     * @return string
98 98
     */
99
-    public function getStringOption(string $name, string $default='') : string
99
+    public function getStringOption(string $name, string $default = '') : string
100 100
     {
101 101
         $value = $this->getOption($name, false);
102 102
         
103
-        if((is_string($value) || is_numeric($value)) && !empty($value)) {
103
+        if ((is_string($value) || is_numeric($value)) && !empty($value)) {
104 104
             return (string)$value;
105 105
         }
106 106
         
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
     * @param string $name
117 117
     * @return bool
118 118
     */
119
-    public function getBoolOption(string $name, bool $default=false) : bool
119
+    public function getBoolOption(string $name, bool $default = false) : bool
120 120
     {
121
-        if($this->getOption($name) === true) {
121
+        if ($this->getOption($name) === true) {
122 122
             return true;
123 123
         }
124 124
         
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
     * @param int $default
135 135
     * @return int
136 136
     */
137
-    public function getIntOption(string $name, int $default=0) : int
137
+    public function getIntOption(string $name, int $default = 0) : int
138 138
     {
139 139
         $value = $this->getOption($name);
140
-        if(ConvertHelper::isInteger($value)) {
140
+        if (ConvertHelper::isInteger($value)) {
141 141
             return (int)$value;
142 142
         }
143 143
         
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public function getArrayOption(string $name) : array
156 156
     {
157 157
         $val = $this->getOption($name);
158
-        if(is_array($val)) {
158
+        if (is_array($val)) {
159 159
             return $val;
160 160
         }
161 161
         
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     */
172 172
     public function hasOption(string $name) : bool
173 173
     {
174
-        if(!isset($this->options)) {
174
+        if (!isset($this->options)) {
175 175
             $this->options = $this->getDefaultOptions();
176 176
         }
177 177
         
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     */
185 185
     public function getOptions() : array
186 186
     {
187
-        if(!isset($this->options)) {
187
+        if (!isset($this->options)) {
188 188
             $this->options = $this->getDefaultOptions();
189 189
         }
190 190
         
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     * @param mixed $default
239 239
     * @return $this
240 240
     */
241
-    function getOption(string $name, $default=null);
241
+    function getOption(string $name, $default = null);
242 242
     
243 243
    /**
244 244
     * @param array $options
Please login to merge, or discard this patch.
src/URLInfo/Highlighter.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class URLInfo_Highlighter
22 22
 {
23
-   /**
24
-    * @var URLInfo
25
-    */
23
+    /**
24
+     * @var URLInfo
25
+     */
26 26
     protected $info;
27 27
     
28 28
     public function __construct(URLInfo $info)
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
         );
159 159
     }
160 160
     
161
-   /**
162
-    * Fetches all parameters in the URL, regardless of 
163
-    * whether parameter exclusion is enabled, so they
164
-    * can be highlighted is need be.
165
-    * 
166
-    * @return array
167
-    */
161
+    /**
162
+     * Fetches all parameters in the URL, regardless of 
163
+     * whether parameter exclusion is enabled, so they
164
+     * can be highlighted is need be.
165
+     * 
166
+     * @return array
167
+     */
168 168
     protected function resolveParams() : array
169 169
     {
170 170
         $previous = $this->info->isParamExclusionEnabled();
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             'fragment'
78 78
         );
79 79
         
80
-        foreach($parts as $part) 
80
+        foreach ($parts as $part) 
81 81
         {
82 82
             $method = 'render_'.$part;
83 83
             $result[] = (string)$this->$method();
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     
89 89
     protected function render_scheme() : string
90 90
     {
91
-        if(!$this->info->hasScheme()) {
91
+        if (!$this->info->hasScheme()) {
92 92
             return '';
93 93
         }
94 94
         
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     
104 104
     protected function render_username() : string
105 105
     {
106
-        if(!$this->info->hasUsername()) {
106
+        if (!$this->info->hasUsername()) {
107 107
             return '';
108 108
         }
109 109
         
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     
120 120
     protected function render_host() : string
121 121
     {
122
-        if(!$this->info->hasHost()) {
122
+        if (!$this->info->hasHost()) {
123 123
             return '';
124 124
         }
125 125
         
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     
132 132
     protected function render_port() : string
133 133
     {
134
-        if(!$this->info->hasPort()) {
134
+        if (!$this->info->hasPort()) {
135 135
             return '';
136 136
         }
137 137
         
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
        
145 145
     protected function render_path() : string
146 146
     {
147
-        if(!$this->info->hasPath()) {
147
+        if (!$this->info->hasPath()) {
148 148
             return '';
149 149
         }
150 150
         
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     {
170 170
         $previous = $this->info->isParamExclusionEnabled();
171 171
         
172
-        if($previous)
172
+        if ($previous)
173 173
         {
174 174
             $this->info->setParamExclusion(false);
175 175
         }
@@ -185,19 +185,19 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $params = $this->resolveParams();
187 187
         
188
-        if(empty($params)) {
188
+        if (empty($params)) {
189 189
             return '';
190 190
         }
191 191
         
192 192
         $tokens = array();
193 193
         $excluded = array();
194 194
         
195
-        if($this->info->isParamExclusionEnabled())
195
+        if ($this->info->isParamExclusionEnabled())
196 196
         {
197 197
             $excluded = $this->info->getExcludedParams();
198 198
         }
199 199
         
200
-        foreach($params as $param => $value)
200
+        foreach ($params as $param => $value)
201 201
         {
202 202
             $parts = sprintf(
203 203
                 '<span class="link-param-name">%s</span>'.
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             
215 215
             $tag = $this->resolveTag($excluded, $param);
216 216
             
217
-            if(!empty($tag))
217
+            if (!empty($tag))
218 218
             {
219 219
                 $tokens[] = sprintf($tag, $parts);
220 220
             }
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
     protected function resolveTag(array $excluded, string $paramName) : string
229 229
     {
230 230
         // regular, non-excluded parameter
231
-        if(!isset($excluded[$paramName]))
231
+        if (!isset($excluded[$paramName]))
232 232
         {
233 233
             return '<span class="link-param">%s</span>';
234 234
         }
235 235
 
236 236
         // highlight excluded parameters is disabled, ignore this parameter
237
-        if(!$this->info->isHighlightExcludeEnabled())
237
+        if (!$this->info->isHighlightExcludeEnabled())
238 238
         {
239 239
             return '';
240 240
         }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      
251 251
     protected function render_fragment() : string
252 252
     {
253
-        if(!$this->info->hasFragment()) {
253
+        if (!$this->info->hasFragment()) {
254 254
             return '';
255 255
         }
256 256
         
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     {
266 266
         $cssFolder = realpath(__DIR__.'/../../css');
267 267
         
268
-        if($cssFolder === false) {
268
+        if ($cssFolder === false) {
269 269
             throw new BaseException(
270 270
                 'Cannot find package CSS folder.',
271 271
                 null,
Please login to merge, or discard this patch.
src/URLInfo/Parser.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -20,24 +20,24 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class URLInfo_Parser
22 22
 {
23
-   /**
24
-    * @var string
25
-    */
23
+    /**
24
+     * @var string
25
+     */
26 26
     protected $url;
27 27
     
28
-   /**
29
-    * @var bool
30
-    */
28
+    /**
29
+     * @var bool
30
+     */
31 31
     protected $isValid = false;
32 32
     
33
-   /**
34
-    * @var array
35
-    */
33
+    /**
34
+     * @var array
35
+     */
36 36
     protected $info;
37 37
     
38
-   /**
39
-    * @var array|NULL
40
-    */
38
+    /**
39
+     * @var array|NULL
40
+     */
41 41
     protected $error;
42 42
     
43 43
     /**
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
         return false;
178 178
     }
179 179
 
180
-   /**
181
-    * Goes through all information in the parse_url result
182
-    * array, and attempts to fix any user errors in formatting
183
-    * that can be recovered from, mostly regarding stray spaces.
184
-    */
180
+    /**
181
+     * Goes through all information in the parse_url result
182
+     * array, and attempts to fix any user errors in formatting
183
+     * that can be recovered from, mostly regarding stray spaces.
184
+     */
185 185
     protected function filterParsed()
186 186
     {
187 187
         $this->info['params'] = array();
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         
60 60
         $this->parse();
61 61
         
62
-        if(!$this->detectType()) {
62
+        if (!$this->detectType()) {
63 63
             $this->validate();
64 64
         }
65 65
     }
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
             'phoneLink'
94 94
         );
95 95
         
96
-        foreach($types as $type)
96
+        foreach ($types as $type)
97 97
         {
98 98
             $method = 'detectType_'.$type;
99 99
             
100
-            if($this->$method() === true) 
100
+            if ($this->$method() === true) 
101 101
             {
102 102
                 $this->isValid = true;
103 103
                 return true;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
             'hostIsPresent'
116 116
         );
117 117
         
118
-        foreach($validations as $validation) 
118
+        foreach ($validations as $validation) 
119 119
         {
120 120
             $method = 'validate_'.$validation;
121 121
             
122
-            if($this->$method() !== true) {
122
+            if ($this->$method() !== true) {
123 123
                 return;
124 124
             }
125 125
         }
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
         // every link needs a host. This case can happen for ex, if
133 133
         // the link starts with a typo with only one slash, like:
134 134
         // "http:/hostname"
135
-        if(isset($this->info['host'])) {
135
+        if (isset($this->info['host'])) {
136 136
             return true;
137 137
         }
138 138
         
139 139
         $this->setError(
140 140
             URLInfo::ERROR_MISSING_HOST,
141
-            t('Cannot determine the link\'s host name.') . ' ' .
141
+            t('Cannot determine the link\'s host name.').' '.
142 142
             t('This usually happens when there\'s a typo somewhere.')
143 143
         );
144 144
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     
148 148
     protected function validate_schemeIsSet() : bool
149 149
     {
150
-        if(isset($this->info['scheme'])) {
150
+        if (isset($this->info['scheme'])) {
151 151
             return true;
152 152
         }
153 153
         
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
     
165 165
     protected function validate_schemeIsKnown() : bool
166 166
     {
167
-        if(in_array($this->info['scheme'], $this->knownSchemes)) {
167
+        if (in_array($this->info['scheme'], $this->knownSchemes)) {
168 168
             return true;
169 169
         }
170 170
         
171 171
         $this->setError(
172 172
             URLInfo::ERROR_INVALID_SCHEME,
173
-            t('The scheme %1$s is not supported for links.', $this->info['scheme']) . ' ' .
173
+            t('The scheme %1$s is not supported for links.', $this->info['scheme']).' '.
174 174
             t('Valid schemes are: %1$s.', implode(', ', $this->knownSchemes))
175 175
         );
176 176
 
@@ -187,23 +187,23 @@  discard block
 block discarded – undo
187 187
         $this->info['params'] = array();
188 188
         $this->info['type'] = URLInfo::TYPE_URL;
189 189
         
190
-        if(isset($this->info['user'])) {
190
+        if (isset($this->info['user'])) {
191 191
             $this->info['user'] = urldecode($this->info['user']);
192 192
         }
193 193
 
194
-        if(isset($this->info['pass'])) {
194
+        if (isset($this->info['pass'])) {
195 195
             $this->info['pass'] = urldecode($this->info['pass']);
196 196
         }
197 197
         
198
-        if(isset($this->info['host'])) {
198
+        if (isset($this->info['host'])) {
199 199
             $this->info['host'] = str_replace(' ', '', $this->info['host']);
200 200
         }
201 201
         
202
-        if(isset($this->info['path'])) {
202
+        if (isset($this->info['path'])) {
203 203
             $this->info['path'] = str_replace(' ', '', $this->info['path']);
204 204
         }
205 205
         
206
-        if(isset($this->info['query']) && !empty($this->info['query']))
206
+        if (isset($this->info['query']) && !empty($this->info['query']))
207 207
         {
208 208
             $this->info['params'] = \AppUtils\ConvertHelper::parseQueryString($this->info['query']);
209 209
             ksort($this->info['params']);
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
     
213 213
     protected function detectType_email() : bool
214 214
     {
215
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
215
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
216 216
             $this->info['type'] = URLInfo::TYPE_EMAIL;
217 217
             return true;
218 218
         }
219 219
         
220
-        if(isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path']))
220
+        if (isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path']))
221 221
         {
222 222
             $this->info['scheme'] = 'mailto';
223 223
             $this->info['type'] = URLInfo::TYPE_EMAIL;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     
230 230
     protected function detectType_fragmentLink() : bool
231 231
     {
232
-        if(isset($this->info['fragment']) && !isset($this->info['scheme'])) {
232
+        if (isset($this->info['fragment']) && !isset($this->info['scheme'])) {
233 233
             $this->info['type'] = URLInfo::TYPE_FRAGMENT;
234 234
             return true;
235 235
         }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     
240 240
     protected function detectType_phoneLink() : bool
241 241
     {
242
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
242
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
243 243
             $this->info['type'] = URLInfo::TYPE_PHONE;
244 244
             return true;
245 245
         }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
     public function getErrorMessage() : string
266 266
     {
267
-        if(isset($this->error)) {
267
+        if (isset($this->error)) {
268 268
             return $this->error['message'];
269 269
         }
270 270
         
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     
274 274
     public function getErrorCode() : int
275 275
     {
276
-        if(isset($this->error)) {
276
+        if (isset($this->error)) {
277 277
             return $this->error['code'];
278 278
         }
279 279
         
Please login to merge, or discard this patch.