Passed
Push — master ( aecd40...074997 )
by Sebastian
10:13 queued 07:17
created
src/AttributeCollection.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function setAttributes(array $attributes) : AttributeCollection
69 69
     {
70
-        foreach($attributes as $name => $value)
70
+        foreach ($attributes as $name => $value)
71 71
         {
72 72
             $this->attr($name, $value);
73 73
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         return $this;
76 76
     }
77 77
 
78
-    public function getAttribute(string $name, string $default='') : string
78
+    public function getAttribute(string $name, string $default = '') : string
79 79
     {
80 80
         return $this->attributes[$name] ?? $default;
81 81
     }
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
      * @param array<string,string|number|bool|NULL|Interface_Stringable|StringBuilder_Interface> $attributes
85 85
      * @return AttributeCollection
86 86
      */
87
-    public static function create(array $attributes=array()) : AttributeCollection
87
+    public static function create(array $attributes = array()) : AttributeCollection
88 88
     {
89 89
         return new AttributeCollection($attributes);
90 90
     }
91 91
 
92
-    public function prop(string $name, bool $enabled=true) : AttributeCollection
92
+    public function prop(string $name, bool $enabled = true) : AttributeCollection
93 93
     {
94
-        if($enabled)
94
+        if ($enabled)
95 95
         {
96 96
             return $this->attr($name, $name);
97 97
         }
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $string = Filtering::value2string($value);
110 110
 
111
-        if($name === 'class')
111
+        if ($name === 'class')
112 112
         {
113 113
             return $this->addClasses(ConvertHelper::explodeTrim(' ', $string));
114 114
         }
115 115
 
116
-        if($name === 'style')
116
+        if ($name === 'style')
117 117
         {
118 118
             $this->styles->parseStylesString($string);
119 119
             return $this;
120 120
         }
121 121
 
122
-        if($string !== '')
122
+        if ($string !== '')
123 123
         {
124 124
             $this->attributes[$name] = $string;
125 125
         }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $this->attr($name, $value);
140 140
 
141
-        if(isset($this->attributes[$name]))
141
+        if (isset($this->attributes[$name]))
142 142
         {
143 143
             $this->attributes[$name] = Filtering::quotes($this->attributes[$name]);
144 144
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
     public function remove(string $name) : AttributeCollection
155 155
     {
156
-        if(isset($this->attributes[$name]))
156
+        if (isset($this->attributes[$name]))
157 157
         {
158 158
             unset($this->attributes[$name]);
159 159
         }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
     private function getRenderer() : AttributesRenderer
177 177
     {
178
-        if(isset($this->renderer))
178
+        if (isset($this->renderer))
179 179
         {
180 180
             return $this->renderer;
181 181
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
     public const TARGET_BLANK = '_blank';
240 240
 
241
-    public function target(string $value=self::TARGET_BLANK) : AttributeCollection
241
+    public function target(string $value = self::TARGET_BLANK) : AttributeCollection
242 242
     {
243 243
         return $this->attr('target', $value);
244 244
     }
Please login to merge, or discard this patch.
src/FileHelper/FolderTree.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $info = FileHelper::getFolderInfo($rootFolder);
24 24
 
25
-        if(!$info->exists())
25
+        if (!$info->exists())
26 26
         {
27 27
             return true;
28 28
         }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         foreach ($d as $item)
33 33
         {
34
-            if(self::processDeleteItem($item) === false)
34
+            if (self::processDeleteItem($item) === false)
35 35
             {
36 36
                 return false;
37 37
             }
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $target = FileHelper::createFolder($target);
102 102
 
103
-        $d =  FileHelper::getPathInfo($source)->requireIsFolder()->getIterator();
103
+        $d = FileHelper::getPathInfo($source)->requireIsFolder()->getIterator();
104 104
 
105 105
         foreach ($d as $item)
106 106
         {
107
-            if($item->isDot())
107
+            if ($item->isDot())
108 108
             {
109 109
                 continue;
110 110
             }
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
         if ($item->isFolder())
127 127
         {
128
-            self::copy($item, $target . '/' . $item->getName());
128
+            self::copy($item, $target.'/'.$item->getName());
129 129
         }
130
-        else if($item->isFile())
130
+        else if ($item->isFile())
131 131
         {
132 132
             $item
133 133
                 ->requireIsFile()
Please login to merge, or discard this patch.
src/ConvertHelper/Bool.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,22 +29,22 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public static function fromString($string) : bool
31 31
     {
32
-        if($string === '' || !is_scalar($string))
32
+        if ($string === '' || !is_scalar($string))
33 33
         {
34 34
             return false;
35 35
         }
36 36
 
37
-        if(is_bool($string))
37
+        if (is_bool($string))
38 38
         {
39 39
             return $string;
40 40
         }
41 41
 
42
-        if(is_string($string))
42
+        if (is_string($string))
43 43
         {
44 44
             $string = strtolower($string);
45 45
         }
46 46
 
47
-        if(array_key_exists($string, self::$booleanStrings))
47
+        if (array_key_exists($string, self::$booleanStrings))
48 48
         {
49 49
             return self::$booleanStrings[$string];
50 50
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     public static function toString($boolean, bool $yesno = false) : string
75 75
     {
76 76
         // allow 'yes', 'true', 'no', 'false' string notations as well
77
-        if(!is_bool($boolean)) {
77
+        if (!is_bool($boolean)) {
78 78
             $boolean = self::fromString($boolean);
79 79
         }
80 80
 
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public static function isBoolean($value) : bool
132 132
     {
133
-        if(is_bool($value)) {
133
+        if (is_bool($value)) {
134 134
             return true;
135 135
         }
136 136
 
137
-        if(!is_scalar($value)) {
137
+        if (!is_scalar($value)) {
138 138
             return false;
139 139
         }
140 140
 
Please login to merge, or discard this patch.
src/LipsumHelper/LipsumDetector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     public function setMinWords(int $min) : self
123 123
     {
124 124
         // Avoid a reset if the value is the same
125
-        if($this->minWords === $min)
125
+        if ($this->minWords === $min)
126 126
         {
127 127
             return $this;
128 128
         }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
     private function detect() : void
144 144
     {
145
-        if($this->detected) {
145
+        if ($this->detected) {
146 146
             return;
147 147
         }
148 148
 
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
         $this->found = array();
151 151
         $this->count = 0;
152 152
 
153
-        foreach(self::$words as $word)
153
+        foreach (self::$words as $word)
154 154
         {
155
-            if(stripos($this->subject, $word) !== false)
155
+            if (stripos($this->subject, $word) !== false)
156 156
             {
157 157
                 $this->count++;
158 158
                 $this->found[] = $word;
159 159
             }
160 160
 
161
-            if($this->count >= $this->minWords) {
161
+            if ($this->count >= $this->minWords) {
162 162
                 break;
163 163
             }
164 164
         }
Please login to merge, or discard this patch.
src/StyleCollection.php 1 patch
Spacing   +17 added lines, -17 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,22 +140,22 @@  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
     }
147 147
 
148
-    public function stylePercent(string $name, float $percent, bool $important=false) : StyleCollection
148
+    public function stylePercent(string $name, float $percent, bool $important = false) : StyleCollection
149 149
     {
150 150
         return $this->style($name, $percent.'%', $important);
151 151
     }
152 152
 
153
-    public function styleEM(string $name, float $em, bool $important=false) : StyleCollection
153
+    public function styleEM(string $name, float $em, bool $important = false) : StyleCollection
154 154
     {
155 155
         return $this->style($name, $em.'em', $important);
156 156
     }
157 157
 
158
-    public function styleREM(string $name, float $em, bool $important=false) : StyleCollection
158
+    public function styleREM(string $name, float $em, bool $important = false) : StyleCollection
159 159
     {
160 160
         return $this->style($name, $em.'rem', $important);
161 161
     }
@@ -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/BaseException.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
     * @param int|NULL $code
32 32
     * @param Throwable|NULL $previous
33 33
     */
34
-    public function __construct(string $message, ?string $details=null, ?int $code=null, ?Throwable $previous=null)
34
+    public function __construct(string $message, ?string $details = null, ?int $code = null, ?Throwable $previous = null)
35 35
     {
36
-        if(defined('APP_UTILS_TESTSUITE') && APP_UTILS_TESTSUITE === 'true')
36
+        if (defined('APP_UTILS_TESTSUITE') && APP_UTILS_TESTSUITE === 'true')
37 37
         {
38 38
             $message .= PHP_EOL.$details;
39 39
         }
40 40
 
41
-        if($code === null)
41
+        if ($code === null)
42 42
         {
43 43
              $code = 0;
44 44
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     */
63 63
     public function display() : void
64 64
     {
65
-        if(!headers_sent()) {
65
+        if (!headers_sent()) {
66 66
             header('Content-type:text/plain; charset=utf-8');
67 67
         }
68 68
         
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         {
90 90
             throw new BaseException('');
91 91
         }
92
-        catch(BaseException $e) 
92
+        catch (BaseException $e) 
93 93
         {
94 94
             echo self::createInfo($e)->toString();
95 95
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         {
105 105
             throw new BaseException('');
106 106
         }
107
-        catch(BaseException $e)
107
+        catch (BaseException $e)
108 108
         {
109 109
             echo '<pre style="background:#fff;font-family:monospace;font-size:14px;color:#444;padding:16px;border:solid 1px #999;border-radius:4px;">';
110 110
             echo self::createInfo($e)->toString();
Please login to merge, or discard this patch.
src/ClassHelper/ClassNotExistsException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
     public function __construct(string $class, ?int $code = null, ?Throwable $previous = null)
24 24
     {
25
-        if($code === null || $code === 0) {
25
+        if ($code === null || $code === 0) {
26 26
             $code = self::ERROR_CODE;
27 27
         }
28 28
 
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
         $this->detectNamespace($code);
127 127
         $result = $this->detectMatches($code);
128 128
 
129
-        if($result === null) {
129
+        if ($result === null) {
130 130
             return;
131 131
         }
132 132
         
133 133
         $indexes = array_keys($result[0]);
134 134
         
135
-        foreach($indexes as $idx)
135
+        foreach ($indexes as $idx)
136 136
         {
137 137
             $this->parseResult(
138 138
                 $result[1][$idx],
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
         preg_match_all('/(abstract|final)\s+('.$types.')\s+([\sa-z\d\\\\_,]+){|('.$types.')\s+([\sa-z\d\\\\_,]+){/ix', $code, $result, PREG_PATTERN_ORDER);
153 153
 
154
-        if(isset($result[0][0])) {
154
+        if (isset($result[0][0])) {
155 155
             return $result;
156 156
         }
157 157
 
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
         $result = array();
164 164
         preg_match_all('/namespace\s+([^;]+);/ix', $code, $result, PREG_PATTERN_ORDER);
165 165
 
166
-        if(isset($result[0][0])) {
166
+        if (isset($result[0][0])) {
167 167
             $this->namespace = trim($result[1][0]);
168 168
         }
169 169
     }
170 170
 
171 171
     private function parseResult(string $keyword, string $declaration, string $type, string $simpleType, string $simpleDeclaration) : void
172 172
     {
173
-        if(empty($keyword)) {
173
+        if (empty($keyword)) {
174 174
             $type = $simpleType;
175 175
             $declaration = $simpleDeclaration;
176 176
         }
Please login to merge, or discard this patch.
src/Value/Bool.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     protected bool $value = false;
23 23
     
24
-    public function __construct(bool $value=false)
24
+    public function __construct(bool $value = false)
25 25
     {
26 26
         $this->value = $value;
27 27
     }
Please login to merge, or discard this patch.