Passed
Push — master ( e76473...8d6fb4 )
by Sebastian
09:39
created
src/FileHelper/PHPClassInfo.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $this->path = realpath($path);
55 55
         
56
-        if($this->path === false)
56
+        if ($this->path === false)
57 57
         {
58 58
             throw new FileHelper_Exception(
59 59
                 'Cannot extract file information: file not found.',
@@ -131,25 +131,25 @@  discard block
 block discarded – undo
131 131
 
132 132
         $result = array();
133 133
         preg_match_all('/namespace[\s]+([^;]+);/six', $code, $result, PREG_PATTERN_ORDER);
134
-        if(isset($result[0]) && isset($result[0][0])) {
134
+        if (isset($result[0]) && isset($result[0][0])) {
135 135
             $this->namespace = trim($result[1][0]);
136 136
         }
137 137
         
138 138
         $result = array();
139 139
         preg_match_all('/(abstract|final)[\s]+(class|trait)[\s]+([\sa-z0-9\\\\_,]+){|(class|trait)[\s]+([\sa-z0-9\\\\_,]+){/six', $code, $result, PREG_PATTERN_ORDER);
140 140
 
141
-        if(!isset($result[0]) || !isset($result[0][0])) {
141
+        if (!isset($result[0]) || !isset($result[0][0])) {
142 142
             return;
143 143
         }
144 144
         
145 145
         $indexes = array_keys($result[0]);
146 146
         
147
-        foreach($indexes as $idx)
147
+        foreach ($indexes as $idx)
148 148
         {
149 149
             $keyword = $result[1][$idx];
150 150
             $declaration = $result[3][$idx];
151 151
             $type = $result[2][$idx];
152
-            if(empty($keyword)) {
152
+            if (empty($keyword)) {
153 153
                 $type = $result[4][$idx];
154 154
                 $declaration = $result[5][$idx];
155 155
             }
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo/Class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $name = $this->getName();
113 113
         
114
-        if($this->info->hasNamespace()) {
114
+        if ($this->info->hasNamespace()) {
115 115
             $name = $this->info->getNamespace().'\\'.$this->name;
116 116
         }
117 117
         
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
         $parts[] = $this->type;
167 167
         $parts[] = $this->getName();
168 168
         
169
-        if(!empty($this->extends)) {
169
+        if (!empty($this->extends)) {
170 170
             $parts[] = 'extends';
171 171
             $parts[] = $this->extends;
172 172
         }
173 173
         
174
-        if(!empty($this->implements)) {
174
+        if (!empty($this->implements)) {
175 175
             $parts[] = 'implements';
176 176
             $parts[] = implode(', ', $this->implements);
177 177
         }
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 
196 196
     protected function analyzeCode() : void
197 197
     {
198
-        if($this->keyword === 'abstract') {
198
+        if ($this->keyword === 'abstract') {
199 199
             $this->abstract = true;
200
-        } else if($this->keyword === 'final') {
200
+        } else if ($this->keyword === 'final') {
201 201
             $this->final = true;
202 202
         }
203 203
         
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
         
215 215
         $tokenName = 'none';
216 216
         
217
-        foreach($parts as $part)
217
+        foreach ($parts as $part)
218 218
         {
219 219
             $part = str_replace(',', '', $part);
220 220
             $part = trim($part);
221
-            if(empty($part)) {
221
+            if (empty($part)) {
222 222
                 continue;
223 223
             }
224 224
             
225 225
             $name = strtolower($part);
226
-            if($name === 'extends' || $name === 'implements') {
226
+            if ($name === 'extends' || $name === 'implements') {
227 227
                 $tokenName = $name;
228 228
                 continue;
229 229
             }
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
         
234 234
         $this->implements = $tokens['implements'];
235 235
         
236
-        if(!empty($this->implements)) {
236
+        if (!empty($this->implements)) {
237 237
             usort($this->implements, function(string $a, string $b) {
238 238
                 return strnatcasecmp($a, $b);
239 239
             });
240 240
         }
241 241
         
242
-        if(!empty($tokens['extends'])) {
242
+        if (!empty($tokens['extends'])) {
243 243
             $this->extends = $tokens['extends'][0];
244 244
         }
245 245
     }
Please login to merge, or discard this patch.
src/StyleCollection.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     /**
34 34
      * @param array<string,string|number|NumberInfo|Interface_Stringable|NULL> $styles
35 35
      */
36
-    public function __construct(array $styles=array())
36
+    public function __construct(array $styles = array())
37 37
     {
38 38
         $this->options = new StyleOptions();
39 39
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param array<string,string|number|NumberInfo|Interface_Stringable|NULL> $styles
45 45
      * @return StyleCollection
46 46
      */
47
-    public static function create(array $styles=array()) : StyleCollection
47
+    public static function create(array $styles = array()) : StyleCollection
48 48
     {
49 49
         return new StyleCollection($styles);
50 50
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $lines = explode(';', $string);
70 70
 
71
-        foreach($lines as $line)
71
+        foreach ($lines as $line)
72 72
         {
73 73
             $parts = explode(':', $line);
74 74
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function setStyles(array $styles) : StyleCollection
91 91
     {
92
-        foreach($styles as $name => $value)
92
+        foreach ($styles as $name => $value)
93 93
         {
94 94
             $this->styleAuto($name, $value);
95 95
         }
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      * @param bool $important
106 106
      * @return $this
107 107
      */
108
-    public function style(string $name, string $value, bool $important=false) : StyleCollection
108
+    public function style(string $name, string $value, bool $important = false) : StyleCollection
109 109
     {
110
-        if($value === '')
110
+        if ($value === '')
111 111
         {
112 112
             return $this;
113 113
         }
114 114
 
115
-        if($important && stripos($value, '!important') === false)
115
+        if ($important && stripos($value, '!important') === false)
116 116
         {
117 117
             $value .= ' !important';
118 118
         }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
      * @param bool $important
131 131
      * @return $this
132 132
      */
133
-    public function styleAuto(string $name, $value, bool $important=false) : StyleCollection
133
+    public function styleAuto(string $name, $value, bool $important = false) : StyleCollection
134 134
     {
135
-        if($value instanceof NumberInfo)
135
+        if ($value instanceof NumberInfo)
136 136
         {
137 137
             return $this->style($name, $value->toCSS(), $important);
138 138
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         return $this->style($name, (string)$value, $important);
141 141
     }
142 142
 
143
-    public function stylePX(string $name, int $px, bool $important=false) : StyleCollection
143
+    public function stylePX(string $name, int $px, bool $important = false) : StyleCollection
144 144
     {
145 145
         return $this->style($name, $px.'px', $important);
146 146
     }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @param bool $important
170 170
      * @return $this
171 171
      */
172
-    public function styleParseNumber(string $name, $value, bool $important=false) : StyleCollection
172
+    public function styleParseNumber(string $name, $value, bool $important = false) : StyleCollection
173 173
     {
174 174
         return $this->styleNumber($name, parseNumber($value), $important);
175 175
     }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      * @param bool $important
183 183
      * @return $this
184 184
      */
185
-    public function styleNumber(string $name, NumberInfo $info, bool $important=false) : StyleCollection
185
+    public function styleNumber(string $name, NumberInfo $info, bool $important = false) : StyleCollection
186 186
     {
187 187
         $this->style($name, $info->toCSS(), $important);
188 188
         return $this;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
     public function remove(string $name) : StyleCollection
192 192
     {
193
-        if(isset($this->styles[$name]))
193
+        if (isset($this->styles[$name]))
194 194
         {
195 195
             unset($this->styles[$name]);
196 196
         }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         $all = self::create();
228 228
 
229
-        foreach($collections as $collection)
229
+        foreach ($collections as $collection)
230 230
         {
231 231
             $all->mergeWith($collection);
232 232
         }
Please login to merge, or discard this patch.
src/RGBAColor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@
 block discarded – undo
339 339
      */
340 340
     private function requireValidComponent(string $name) : void
341 341
     {
342
-        if(in_array($name, self::COLOR_COMPONENTS))
342
+        if (in_array($name, self::COLOR_COMPONENTS))
343 343
         {
344 344
             return;
345 345
         }
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 === '')
34
+            if ($value === '')
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/StyleCollection/StylesRenderer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function render() : string
28 28
     {
29
-        if($this->collection->hasStyles())
29
+        if ($this->collection->hasStyles())
30 30
         {
31 31
             return implode(
32 32
                 $this->resolveSeparator(),
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     private function resolveSuffix() : string
41 41
     {
42
-        if($this->options->isTrailingSemicolonEnabled())
42
+        if ($this->options->isTrailingSemicolonEnabled())
43 43
         {
44 44
             return ';';
45 45
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     private function resolveSeparator() : string
51 51
     {
52
-        if($this->options->isNewlineEnabled())
52
+        if ($this->options->isNewlineEnabled())
53 53
         {
54 54
             return ';'.PHP_EOL;
55 55
         }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $indentLevel = $this->options->getIndentLevel();
63 63
 
64
-        if($indentLevel > 0)
64
+        if ($indentLevel > 0)
65 65
         {
66 66
             return str_repeat($this->options->getIndentChar(), $indentLevel);
67 67
         }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     private function resolveValueSpace() : string
73 73
     {
74
-        if($this->options->isSpaceBeforeValueEnabled())
74
+        if ($this->options->isSpaceBeforeValueEnabled())
75 75
         {
76 76
             return ' ';
77 77
         }
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
         $indent = $this->resolveIndent();
87 87
         $valueSpace = $this->resolveValueSpace();
88 88
 
89
-        if($this->options->isSortingEnabled())
89
+        if ($this->options->isSortingEnabled())
90 90
         {
91 91
             ksort($styles);
92 92
         }
93 93
 
94
-        foreach($styles as $name => $value)
94
+        foreach ($styles as $name => $value)
95 95
         {
96 96
             $lines[] = sprintf(
97 97
                 '%s%s:%s%s',
Please login to merge, or discard this patch.
src/StyleCollection/StyleOptions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
         );
32 32
     }
33 33
 
34
-    public function enableSorting(bool $enabled=true) : StyleOptions
34
+    public function enableSorting(bool $enabled = true) : StyleOptions
35 35
     {
36 36
         return $this->setOption(self::OPTION_SORTING, $enabled);
37 37
     }
38 38
 
39
-    public function enableSpaceBeforeValue(bool $enabled=true) : StyleOptions
39
+    public function enableSpaceBeforeValue(bool $enabled = true) : StyleOptions
40 40
     {
41 41
         return $this->setOption(self::OPTION_SPACE_BEFORE_VALUE, $enabled);
42 42
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param bool $enabled
46 46
      * @return $this
47 47
      */
48
-    public function enableNewline(bool $enabled=true) : StyleOptions
48
+    public function enableNewline(bool $enabled = true) : StyleOptions
49 49
     {
50 50
         return $this->setOption(self::OPTION_NEWLINES, $enabled);
51 51
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         return $this->getStringOption(self::OPTION_INDENT_CHAR);
119 119
     }
120 120
 
121
-    public function enableTrailingSemicolon(bool $enabled=true) : StyleOptions
121
+    public function enableTrailingSemicolon(bool $enabled = true) : StyleOptions
122 122
     {
123 123
         return $this->setOption(self::OPTION_TRAILING_SEMICOLON, $enabled);
124 124
     }
Please login to merge, or discard this patch.
src/StyleCollection/StyleBuilder/Flavors/Display.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,27 +24,27 @@
 block discarded – undo
24 24
      * @param bool $important
25 25
      * @return StyleBuilder
26 26
      */
27
-    public function custom(string $value, bool $important=false) : StyleBuilder
27
+    public function custom(string $value, bool $important = false) : StyleBuilder
28 28
     {
29 29
         return $this->setStyle($value, $important);
30 30
     }
31 31
 
32
-    public function block(bool $important=false) : StyleBuilder
32
+    public function block(bool $important = false) : StyleBuilder
33 33
     {
34 34
         return $this->setStyle('block', $important);
35 35
     }
36 36
 
37
-    public function none(bool $important=false) : StyleBuilder
37
+    public function none(bool $important = false) : StyleBuilder
38 38
     {
39 39
         return $this->setStyle('none', $important);
40 40
     }
41 41
 
42
-    public function inline(bool $important=false) : StyleBuilder
42
+    public function inline(bool $important = false) : StyleBuilder
43 43
     {
44 44
         return $this->setStyle('inline', $important);
45 45
     }
46 46
 
47
-    public function inlineBlock(bool $important=false) : StyleBuilder
47
+    public function inlineBlock(bool $important = false) : StyleBuilder
48 48
     {
49 49
         return $this->setStyle('inline-block', $important);
50 50
     }
Please login to merge, or discard this patch.
src/StyleCollection/StyleBuilder/Flavors/Width.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         return 'width';
15 15
     }
16 16
 
17
-    public function auto(bool $important=false) : StyleBuilder
17
+    public function auto(bool $important = false) : StyleBuilder
18 18
     {
19 19
         return $this->setStyle('auto', $important);
20 20
     }
Please login to merge, or discard this patch.