Passed
Push — master ( 428f46...c925bb )
by Sebastian
02:32
created
src/XMLHelper/SimpleXML.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         // add any errors that were triggered, using the
53 53
         // error wrappers.
54 54
         $errors = libxml_get_errors();
55
-        foreach($errors as $error) {
55
+        foreach ($errors as $error) {
56 56
             $this->errors[] = new XMLHelper_SimpleXML_Error($this, $error);
57 57
         }
58 58
         
Please login to merge, or discard this patch.
src/Request/URLComparer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     
32 32
     public function addLimitParam(string $name) : Request_URLComparer
33 33
     {
34
-        if(!in_array($name, $this->limitParams)) {
34
+        if (!in_array($name, $this->limitParams)) {
35 35
             $this->limitParams[] = $name;
36 36
         }
37 37
         
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
     
41 41
     public function addLimitParams(array $names) : Request_URLComparer
42 42
     {
43
-        foreach($names as $name) {
43
+        foreach ($names as $name) {
44 44
             $this->addLimitParam($name);
45 45
         }
46 46
         
47 47
         return $this;
48 48
     }
49 49
     
50
-    public function setIgnoreFragment(bool $ignore=true) : Request_URLComparer
50
+    public function setIgnoreFragment(bool $ignore = true) : Request_URLComparer
51 51
     {
52 52
         $this->ignoreFragment = $ignore;
53 53
         return $this;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     
56 56
     protected function init()
57 57
     {
58
-        if(isset($this->isMatch)) {
58
+        if (isset($this->isMatch)) {
59 59
             return;
60 60
         }
61 61
         
@@ -77,25 +77,25 @@  discard block
 block discarded – undo
77 77
             'query' 
78 78
         );
79 79
         
80
-        if(!$this->ignoreFragment) {
80
+        if (!$this->ignoreFragment) {
81 81
             $keys[] = 'fragment';
82 82
         }
83 83
         
84
-        foreach($keys as $key)
84
+        foreach ($keys as $key)
85 85
         {
86 86
             $sVal = '';
87 87
             $tVal = '';
88 88
             
89
-            if(isset($sInfo[$key])) { $sVal = $sInfo[$key]; }
90
-            if(isset($tInfo[$key])) { $tVal = $tInfo[$key]; }
89
+            if (isset($sInfo[$key])) { $sVal = $sInfo[$key]; }
90
+            if (isset($tInfo[$key])) { $tVal = $tInfo[$key]; }
91 91
             
92 92
             $filter = 'filter_'.$key;
93
-            if(method_exists($this, $filter)) {
93
+            if (method_exists($this, $filter)) {
94 94
                 $sVal = $this->$filter($sVal);
95 95
                 $tVal = $this->$filter($tVal);
96 96
             }
97 97
             
98
-            if($sVal !== $tVal) {
98
+            if ($sVal !== $tVal) {
99 99
                 return false;
100 100
             }
101 101
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     protected function filter_path(string $path) : string
107 107
     {
108 108
         // fix double slashes in URLs
109
-        while(stristr($path, '//')) {
109
+        while (stristr($path, '//')) {
110 110
             $path = str_replace('//', '/', $path);
111 111
         }
112 112
         
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     
116 116
     protected function filter_query(string $query) : string
117 117
     {
118
-        if(empty($query)) {
118
+        if (empty($query)) {
119 119
             return '';
120 120
         }
121 121
         
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
         
124 124
         ksort($params);
125 125
         
126
-        if(!empty($this->limitParams))
126
+        if (!empty($this->limitParams))
127 127
         {
128 128
             $keep = array();
129 129
             
130
-            foreach($this->limitParams as $name)
130
+            foreach ($this->limitParams as $name)
131 131
             {
132
-                if(isset($params[$name])) {
132
+                if (isset($params[$name])) {
133 133
                     $keep[$name] = $params[$name];
134 134
                 }
135 135
             }
Please login to merge, or discard this patch.
src/IniHelper/Line.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->trimmed = trim($text);
79 79
         $this->lineNumber = $lineNumber;
80 80
         
81
-        if(empty($this->trimmed)) 
81
+        if (empty($this->trimmed)) 
82 82
         {
83 83
             $this->type = self::TYPE_EMPTY;
84 84
             return;
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
         
87 87
         $startChar = substr($this->trimmed, 0, 1);
88 88
         
89
-        if($startChar === ';')
89
+        if ($startChar === ';')
90 90
         {
91 91
             $this->type = self::TYPE_COMMENT;
92 92
         }
93
-        else if($startChar === '[')
93
+        else if ($startChar === '[')
94 94
         {
95 95
             $this->type = self::TYPE_SECTION_DECLARATION;
96 96
             $this->sectionName = trim($this->trimmed, '[]');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         else
100 100
         {
101 101
             $pos = strpos($this->trimmed, '=');
102
-            if($pos === false) 
102
+            if ($pos === false) 
103 103
             {
104 104
                 $this->type = self::TYPE_INVALID;
105 105
                 return;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $this->type = self::TYPE_VALUE;
109 109
             $this->varName = trim(substr($this->trimmed, 0, $pos));
110 110
             
111
-            $this->parseValue(substr($this->trimmed, $pos+1));
111
+            $this->parseValue(substr($this->trimmed, $pos + 1));
112 112
         }
113 113
     }
114 114
     
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
         
119 119
         $value = $this->varValue;
120 120
         
121
-        if(substr($value, 0, 1) == '"' && substr($value, -1, 1) == '"')
121
+        if (substr($value, 0, 1) == '"' && substr($value, -1, 1) == '"')
122 122
         {
123 123
             $value = trim($value, '"');
124 124
             $this->quoteStyle = '"';
125 125
         }
126
-        else if(substr($value, 0, 1) == "'" && substr($value, -1, 1) == "'")
126
+        else if (substr($value, 0, 1) == "'" && substr($value, -1, 1) == "'")
127 127
         {
128 128
             $value = trim($value, "'");
129 129
             $this->quoteStyle = "'";
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     
145 145
     public function getQuotedVarValue() : string
146 146
     {
147
-        if($this->quoteStyle === '') {
147
+        if ($this->quoteStyle === '') {
148 148
             return $this->getVarValue();
149 149
         }
150 150
         
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     
199 199
     public function setValue($value) : IniHelper_Line
200 200
     {
201
-        if(!is_scalar($value)) 
201
+        if (!is_scalar($value)) 
202 202
         {
203 203
             throw new IniHelper_Exception(
204 204
                 'Cannot use non-scalar values.',
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     
219 219
     public function toString() : string
220 220
     {
221
-        switch($this->type) 
221
+        switch ($this->type) 
222 222
         {
223 223
             case self::TYPE_EMPTY:
224 224
             case self::TYPE_INVALID:
Please login to merge, or discard this patch.
src/IniHelper/Section.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $result = array();
88 88
         
89
-        foreach($this->lines as $line)
89
+        foreach ($this->lines as $line)
90 90
         {
91
-            if(!$line->isValue()) {
91
+            if (!$line->isValue()) {
92 92
                 continue;
93 93
             }
94 94
 
95 95
             $name = $line->getVarName();
96 96
             
97
-            if(!isset($result[$name])) 
97
+            if (!isset($result[$name])) 
98 98
             {
99 99
                 $result[$name] = $line->getVarValue();
100 100
                 continue;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             // name exists in collection? Then this is a
104 104
             // duplicate key and we need to convert it to
105 105
             // an indexed array of values.
106
-            if(!is_array($result[$name])) 
106
+            if (!is_array($result[$name])) 
107 107
             {
108 108
                 $result[$name] = array($result[$name]);
109 109
             }
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
     public function toString()
123 123
     {
124 124
         $lines = array();
125
-        if(!$this->isDefault()) 
125
+        if (!$this->isDefault()) 
126 126
         {
127 127
             $lines[] = '['.$this->getName().']';
128 128
         }
129 129
         
130
-        foreach($this->lines as $line) 
130
+        foreach ($this->lines as $line) 
131 131
         {
132 132
             // we already did this
133
-            if($line->isSection()) {
133
+            if ($line->isSection()) {
134 134
                 continue;
135 135
             }
136 136
             
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
     {
151 151
         $keep = array();
152 152
         
153
-        foreach($this->lines as $line)
153
+        foreach ($this->lines as $line)
154 154
         {
155
-            if($line !== $toDelete) {
155
+            if ($line !== $toDelete) {
156 156
                 $keep[] = $line;
157 157
             }
158 158
         }
@@ -177,23 +177,23 @@  discard block
 block discarded – undo
177 177
         // Removes any superfluous values that may
178 178
         // already exist, if there are more than the
179 179
         // new set of values.
180
-        if(is_array($value))
180
+        if (is_array($value))
181 181
         {
182 182
             $values = array_values($value);
183 183
             $amountNew = count($values);
184 184
             $amountExisting = count($lines);
185 185
             
186 186
             $max = $amountNew;
187
-            if($amountExisting > $max) {
187
+            if ($amountExisting > $max) {
188 188
                 $max = $amountExisting;
189 189
             }
190 190
             
191
-            for($i=0; $i < $max; $i++) 
191
+            for ($i = 0; $i < $max; $i++) 
192 192
             {
193 193
                 // new value exists
194
-                if(isset($values[$i]))
194
+                if (isset($values[$i]))
195 195
                 {
196
-                    if(isset($lines[$i])) {
196
+                    if (isset($lines[$i])) {
197 197
                         $lines[$i]->setValue($values[$i]);
198 198
                     } else {
199 199
                         $this->addValueLine($name, $values[$i]);
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
         else
212 212
         {
213 213
             // remove all superfluous lines
214
-            if(!empty($lines))
214
+            if (!empty($lines))
215 215
             {
216 216
                 $line = array_shift($lines); // keep only the first line
217 217
                 $line->setValue($value);
218 218
                 
219
-                foreach($lines as $delete) {
219
+                foreach ($lines as $delete) {
220 220
                     $this->deleteLine($delete);
221 221
                 }
222 222
             }
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
     public function addValue(string $name, $value) : IniHelper_Section
242 242
     {
243 243
         // array value? Treat it as duplicate keys.
244
-        if(is_array($value))
244
+        if (is_array($value))
245 245
         {
246 246
             $values = array_values($value);
247 247
             
248
-            foreach($values as $setValue)
248
+            foreach ($values as $setValue)
249 249
             {
250 250
                 $this->addValue($name, $setValue);
251 251
             }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         
256 256
         $lines = $this->getLinesByVariable($name);
257 257
         
258
-        if(empty($lines))
258
+        if (empty($lines))
259 259
         {
260 260
             $this->addValueLine($name, $value);
261 261
         }
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
         {
264 264
             $found = false;
265 265
             
266
-            foreach($lines as $line)
266
+            foreach ($lines as $line)
267 267
             {
268
-                if($line->getVarValue() === $value) {
268
+                if ($line->getVarValue() === $value) {
269 269
                     $found = $line;
270 270
                     break;
271 271
                 }
272 272
             }
273 273
             
274
-            if(!$found)
274
+            if (!$found)
275 275
             {
276 276
                 $this->addValueLine($name, $value);
277 277
             }
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $result = array();
307 307
         
308
-        foreach($this->lines as $line)
308
+        foreach ($this->lines as $line)
309 309
         {
310
-            if($line->isValue() && $line->getVarName() === $name) {
310
+            if ($line->isValue() && $line->getVarName() === $name) {
311 311
                 $result[] = $line;
312 312
             }
313 313
         }
Please login to merge, or discard this patch.
src/ZIPHelper.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
src/Transliteration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/URLInfo.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -117,26 +117,26 @@  discard block
 block discarded – undo
117 117
 
118 118
         $this->filterParsed();
119 119
         
120
-        if($this->detectEmail()) {
120
+        if ($this->detectEmail()) {
121 121
             return;
122 122
         }
123 123
         
124
-        if($this->detectFragmentLink()) {
124
+        if ($this->detectFragmentLink()) {
125 125
             return;
126 126
         }
127 127
         
128
-        if($this->detectPhoneLink()) {
128
+        if ($this->detectPhoneLink()) {
129 129
             return;
130 130
         }
131 131
         
132
-        if(!$this->isValid) {
132
+        if (!$this->isValid) {
133 133
             return;
134 134
         }
135 135
         
136 136
         // no scheme found: it may be an email address without the mailto:
137 137
         // It can't be a variable, since without the scheme it would already
138 138
         // have been recognized as a vaiable only link.
139
-        if(!isset($this->info['scheme'])) {
139
+        if (!isset($this->info['scheme'])) {
140 140
             $this->setError(
141 141
                 self::ERROR_MISSING_SCHEME,
142 142
                 t('Cannot determine the link\'s scheme, e.g. %1$s.', 'http')
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
             return;
146 146
         }
147 147
         
148
-        if(!in_array($this->info['scheme'], $this->knownSchemes)) {
148
+        if (!in_array($this->info['scheme'], $this->knownSchemes)) {
149 149
             $this->setError(
150 150
                 self::ERROR_INVALID_SCHEME,
151
-                t('The scheme %1$s is not supported for links.', $this->info['scheme']) . ' ' .
151
+                t('The scheme %1$s is not supported for links.', $this->info['scheme']).' '.
152 152
                 t('Valid schemes are: %1$s.', implode(', ', $this->knownSchemes))
153 153
             );
154 154
             $this->isValid = false;
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
         // every link needs a host. This case can happen for ex, if
159 159
         // the link starts with a typo with only one slash, like:
160 160
         // "http:/hostname"
161
-        if(!isset($this->info['host'])) {
161
+        if (!isset($this->info['host'])) {
162 162
             $this->setError(
163 163
                 self::ERROR_MISSING_HOST,
164
-                t('Cannot determine the link\'s host name.') . ' ' .
164
+                t('Cannot determine the link\'s host name.').' '.
165 165
                 t('This usually happens when there\'s a typo somewhere.')
166 166
             );
167 167
             $this->isValid = false;
168 168
             return;
169 169
         }
170 170
 
171
-        if(!empty($this->info['query'])) 
171
+        if (!empty($this->info['query'])) 
172 172
         {
173 173
             $this->params = \AppUtils\ConvertHelper::parseQueryString($this->info['query']);
174 174
             ksort($this->params);
@@ -213,30 +213,30 @@  discard block
 block discarded – undo
213 213
     */
214 214
     protected function filterParsed()
215 215
     {
216
-        foreach($this->info as $key => $val)
216
+        foreach ($this->info as $key => $val)
217 217
         {
218
-            if(is_string($val)) {
218
+            if (is_string($val)) {
219 219
                 $this->info[$key] = trim($val);
220 220
             }
221 221
         }
222 222
         
223
-        if(isset($this->info['host'])) {
223
+        if (isset($this->info['host'])) {
224 224
             $this->info['host'] = str_replace(' ', '', $this->info['host']);
225 225
         }
226 226
         
227
-        if(isset($this->info['path'])) {
227
+        if (isset($this->info['path'])) {
228 228
             $this->info['path'] = str_replace(' ', '', $this->info['path']);
229 229
         }
230 230
     }
231 231
     
232 232
     protected function detectEmail()
233 233
     {
234
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
234
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
235 235
             $this->isEmail = true;
236 236
             return true;
237 237
         }
238 238
         
239
-        if(isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path'])) 
239
+        if (isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path'])) 
240 240
         {
241 241
             $this->info['scheme'] = 'email';
242 242
             $this->isEmail = true;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     
249 249
     protected function detectFragmentLink()
250 250
     {
251
-        if(isset($this->info['fragment']) && !isset($this->info['scheme'])) {
251
+        if (isset($this->info['fragment']) && !isset($this->info['scheme'])) {
252 252
             $this->isFragment = true;
253 253
             return true;
254 254
         }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     
259 259
     protected function detectPhoneLink()
260 260
     {
261
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
261
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
262 262
             $this->isPhone = true;
263 263
             return true;
264 264
         }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function isSecure()
274 274
     {
275
-        if(isset($this->info['scheme']) && $this->info['scheme']=='https') {
275
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'https') {
276 276
             return true;
277 277
         }
278 278
         
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
     public function getPort() : int
348 348
     {
349 349
         $port = $this->getInfoKey('port');
350
-        if(!empty($port)) {
350
+        if (!empty($port)) {
351 351
             return (int)$port;
352 352
         }
353 353
         
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     
428 428
     protected function getInfoKey(string $name) : string
429 429
     {
430
-        if(isset($this->info[$name])) {
430
+        if (isset($this->info[$name])) {
431 431
             return (string)$this->info[$name];
432 432
         }
433 433
         
@@ -436,34 +436,34 @@  discard block
 block discarded – undo
436 436
     
437 437
     public function getNormalized() : string
438 438
     {
439
-        if(!$this->isValid) {
439
+        if (!$this->isValid) {
440 440
             return '';
441 441
         }
442 442
         
443
-        if($this->isFragment === true)
443
+        if ($this->isFragment === true)
444 444
         {
445 445
             return '#'.$this->getFragment();
446 446
         }
447
-        else if($this->isPhone === true)
447
+        else if ($this->isPhone === true)
448 448
         {
449 449
             return 'tel://'.$this->getHost();
450 450
         }
451
-        else if($this->isEmail === true)
451
+        else if ($this->isEmail === true)
452 452
         {
453 453
             return 'mailto:'.$this->getPath();
454 454
         }
455 455
         
456 456
         $normalized = $this->info['scheme'].'://'.$this->info['host'];
457
-        if(isset($this->info['path'])) {
457
+        if (isset($this->info['path'])) {
458 458
             $normalized .= $this->info['path'];
459 459
         }
460 460
         
461 461
         $params = $this->getParams();
462
-        if(!empty($params)) {
462
+        if (!empty($params)) {
463 463
             $normalized .= '?'.http_build_query($params);
464 464
         }
465 465
         
466
-        if(isset($this->info['fragment'])) {
466
+        if (isset($this->info['fragment'])) {
467 467
             $normalized .= '#'.$this->info['fragment'];
468 468
         }
469 469
         
@@ -491,11 +491,11 @@  discard block
 block discarded – undo
491 491
     */
492 492
     public function getHighlighted() : string
493 493
     {
494
-        if(!$this->isValid) {
494
+        if (!$this->isValid) {
495 495
             return '';
496 496
         }
497 497
         
498
-        if($this->isEmail) {
498
+        if ($this->isEmail) {
499 499
             return sprintf(
500 500
                 '<span class="link-scheme scheme-mailto">mailto:</span>'.
501 501
                 '<span class="link-host">%s</span>',
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             );
504 504
         }
505 505
         
506
-        if($this->isFragment) {
506
+        if ($this->isFragment) {
507 507
             return sprintf(
508 508
                 '<span class="link-fragment-sign">#</span>'.
509 509
                 '<span class="link-fragment-value">%s</span>',
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
             );
512 512
         }
513 513
         
514
-        if($this->hasScheme())
514
+        if ($this->hasScheme())
515 515
         {
516 516
             $result = sprintf(
517 517
                 '<span class="link-scheme scheme-%1$s">'.
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
         $result .= '<span class="link-component double-slashes">//</span>';
525 525
         
526
-        if($this->hasUsername())
526
+        if ($this->hasUsername())
527 527
         {
528 528
             $result .= sprintf(
529 529
                 '<span class="link-credentials">%s</span>'.
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
             );
536 536
         }
537 537
         
538
-        if($this->hasHost()) 
538
+        if ($this->hasHost()) 
539 539
         {
540 540
             $result .=
541 541
             sprintf(
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
             );
545 545
         }
546 546
         
547
-        if($this->hasPort()) 
547
+        if ($this->hasPort()) 
548 548
         {
549 549
             $result .= sprintf(
550 550
                 '<span class="link-component port-separator">:</span>'.
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
             );
554 554
         }
555 555
         
556
-        if($this->hasPath()) 
556
+        if ($this->hasPath()) 
557 557
         {
558 558
             $path = str_replace(array(';', '='), array(';<wbr>', '=<wbr>'), $this->getPath());
559 559
             $tokens = explode('/', $path);
@@ -564,11 +564,11 @@  discard block
 block discarded – undo
564 564
             );
565 565
         }
566 566
         
567
-        if(!empty($this->params))
567
+        if (!empty($this->params))
568 568
         {
569 569
             $tokens = array();
570 570
             
571
-            foreach($this->params as $param => $value)
571
+            foreach ($this->params as $param => $value)
572 572
             {
573 573
                 $parts = sprintf(
574 574
                     '<span class="link-param-name">%s</span>'.
@@ -586,10 +586,10 @@  discard block
 block discarded – undo
586 586
                 $tag = '';
587 587
                 
588 588
                 // is parameter exclusion enabled, and is this an excluded parameter?
589
-                if($this->paramExclusion && isset($this->excludedParams[$param]))
589
+                if ($this->paramExclusion && isset($this->excludedParams[$param]))
590 590
                 {
591 591
                     // display the excluded parameter, but highlight it
592
-                    if($this->highlightExcluded)
592
+                    if ($this->highlightExcluded)
593 593
                     {
594 594
                         $tooltip = $this->excludedParams[$param];
595 595
                         
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
             '<span class="link-component query-sign">?</span>'.implode('<span class="link-component param-separator">&amp;</span>', $tokens);
620 620
         }
621 621
         
622
-        if(isset($this->info['fragment'])) {
622
+        if (isset($this->info['fragment'])) {
623 623
             $result .= sprintf(
624 624
                 '<span class="link-fragment-sign">#</span>'.
625 625
                 '<span class="link-fragment">%s</span>',
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
     
643 643
     public function getErrorMessage() : string
644 644
     {
645
-        if(isset($this->error)) {
645
+        if (isset($this->error)) {
646 646
             return $this->error['message'];
647 647
         }
648 648
         
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
     
652 652
     public function getErrorCode() : int
653 653
     {
654
-        if(isset($this->error)) {
654
+        if (isset($this->error)) {
655 655
             return $this->error['code'];
656 656
         }
657 657
         
@@ -681,13 +681,13 @@  discard block
 block discarded – undo
681 681
     */
682 682
     public function getParams() : array
683 683
     {
684
-        if(!$this->paramExclusion || empty($this->excludedParams)) {
684
+        if (!$this->paramExclusion || empty($this->excludedParams)) {
685 685
             return $this->params;
686 686
         }
687 687
         
688 688
         $keep = array();
689
-        foreach($this->params as $name => $value) {
690
-            if(!isset($this->excludedParams[$name])) {
689
+        foreach ($this->params as $name => $value) {
690
+            if (!isset($this->excludedParams[$name])) {
691 691
                 $keep[$name] = $value;
692 692
             }
693 693
         }
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
     */
718 718
     public function excludeParam(string $name, string $reason) : URLInfo
719 719
     {
720
-        if(!isset($this->excludedParams[$name]))
720
+        if (!isset($this->excludedParams[$name]))
721 721
         {
722 722
             $this->excludedParams[$name] = $reason;
723 723
             $this->setParamExclusion();
@@ -738,15 +738,15 @@  discard block
 block discarded – undo
738 738
      */
739 739
     public function getType() : string
740 740
     {
741
-        if($this->isEmail) {
741
+        if ($this->isEmail) {
742 742
             return self::TYPE_EMAIL;
743 743
         }
744 744
         
745
-        if($this->isFragment) {
745
+        if ($this->isFragment) {
746 746
             return self::TYPE_FRAGMENT;
747 747
         }
748 748
         
749
-        if($this->isPhone) {
749
+        if ($this->isPhone) {
750 750
             return self::TYPE_PHONE;
751 751
         }
752 752
         
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
     
756 756
     public function getTypeLabel() : string
757 757
     {
758
-        if(!isset(self::$typeLabels))
758
+        if (!isset(self::$typeLabels))
759 759
         {
760 760
             self::$typeLabels = array(
761 761
                 self::TYPE_EMAIL => t('Email'),
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
         
768 768
         $type = $this->getType();
769 769
         
770
-        if(!isset(self::$typeLabels[$type]))
770
+        if (!isset(self::$typeLabels[$type]))
771 771
         {
772 772
             throw new BaseException(
773 773
                 sprintf('Unknown URL type label for type [%s].', $type),
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
     * @param bool $highlight
788 788
     * @return URLInfo
789 789
     */
790
-    public function setHighlightExcluded(bool $highlight=true) : URLInfo
790
+    public function setHighlightExcluded(bool $highlight = true) : URLInfo
791 791
     {
792 792
         $this->highlightExcluded = $highlight;
793 793
         return $this;
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
      * @see URLInfo::isParamExclusionEnabled()
836 836
      * @see URLInfo::setHighlightExcluded()
837 837
      */
838
-    public function setParamExclusion(bool $enabled=true) : URLInfo
838
+    public function setParamExclusion(bool $enabled = true) : URLInfo
839 839
     {
840 840
         $this->paramExclusion = $enabled;
841 841
         return $this;
@@ -861,13 +861,13 @@  discard block
 block discarded – undo
861 861
     */
862 862
     public function containsExcludedParams() : bool
863 863
     {
864
-        if(empty($this->excludedParams)) {
864
+        if (empty($this->excludedParams)) {
865 865
             return false;
866 866
         }
867 867
         
868 868
         $names = array_keys($this->params);
869
-        foreach($names as $name) {
870
-            if(isset($this->excludedParams[$name])) {
869
+        foreach ($names as $name) {
870
+            if (isset($this->excludedParams[$name])) {
871 871
                 return true;
872 872
             }
873 873
         }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 
884 884
     public function offsetSet($offset, $value) 
885 885
     {
886
-        if(in_array($offset, $this->infoKeys)) {
886
+        if (in_array($offset, $this->infoKeys)) {
887 887
             $this->info[$offset] = $value;
888 888
         }
889 889
     }
@@ -900,11 +900,11 @@  discard block
 block discarded – undo
900 900
     
901 901
     public function offsetGet($offset) 
902 902
     {
903
-        if($offset === 'port') {
903
+        if ($offset === 'port') {
904 904
             return $this->getPort();
905 905
         }
906 906
         
907
-        if(in_array($offset, $this->infoKeys)) {
907
+        if (in_array($offset, $this->infoKeys)) {
908 908
             return $this->getInfoKey($offset);
909 909
         }
910 910
         
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
     {
916 916
         $cssFolder = realpath(__DIR__.'/../css');
917 917
         
918
-        if($cssFolder === false) {
918
+        if ($cssFolder === false) {
919 919
             throw new BaseException(
920 920
                 'Cannot find package CSS folder.',
921 921
                 null,
Please login to merge, or discard this patch.
src/CSVHelper/Builder.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         return $this->setOption('separatorChar', $char);
18 18
     }
19 19
     
20
-    public function setTrailingNewline($useNewline=true)
20
+    public function setTrailingNewline($useNewline = true)
21 21
     {
22 22
         return $this->setOption('trailingNewline', $useNewline);
23 23
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $args = $args[0];
39 39
         }
40 40
 
41
-        $this->lines[] = '"' . implode('"'.$this->getOption('separatorChar').'"', $args) . '"';
41
+        $this->lines[] = '"'.implode('"'.$this->getOption('separatorChar').'"', $args).'"';
42 42
         
43 43
         return $this;
44 44
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $csv = implode(PHP_EOL, $this->lines);
56 56
 
57
-        if($this->getOption('trailingNewline')) {
57
+        if ($this->getOption('trailingNewline')) {
58 58
             $csv .= PHP_EOL;
59 59
         }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     
66 66
     public function setOption($name, $value)
67 67
     {
68
-        if(!isset($this->options)) {
68
+        if (!isset($this->options)) {
69 69
             $this->options = $this->getDefaultOptions();
70 70
         }
71 71
         
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
     
76 76
     public function setOptions($options)
77 77
     {
78
-        foreach($options as $name => $value) {
78
+        foreach ($options as $name => $value) {
79 79
             $this->setOption($name, $value);
80 80
         }
81 81
         
82 82
         return $this;
83 83
     }
84 84
     
85
-    public function getOption($name, $default=null)
85
+    public function getOption($name, $default = null)
86 86
     {
87
-        if(!isset($this->options)) {
87
+        if (!isset($this->options)) {
88 88
             $this->options = $this->getDefaultOptions();
89 89
         }
90 90
         
91
-        if(isset($this->options[$name])) {
91
+        if (isset($this->options[$name])) {
92 92
             return $this->options[$name];
93 93
         }
94 94
         
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     
98 98
     public function hasOption($name)
99 99
     {
100
-        if(!isset($this->options)) {
100
+        if (!isset($this->options)) {
101 101
             $this->options = $this->getDefaultOptions();
102 102
         }
103 103
         
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     
107 107
     public function getOptions()
108 108
     {
109
-        if(!isset($this->options)) {
109
+        if (!isset($this->options)) {
110 110
             $this->options = $this->getDefaultOptions();
111 111
         }
112 112
         
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     
116 116
     public function isOption($name, $value)
117 117
     {
118
-        if($this->getOption($name) === $value) {
118
+        if ($this->getOption($name) === $value) {
119 119
             return true;
120 120
         }
121 121
         
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             
Please login to merge, or discard this patch.