Completed
Branch master (55a5ae)
by Raffael
03:40
created
src/Log/Adapter/AbstractAdapter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param Iterable $options
52 52
      * @return void
53 53
      */
54
-    public function __construct(?Iterable $config=null)
54
+    public function __construct(? Iterable $config = null)
55 55
     {
56 56
         $this->setOptions($config);
57 57
     }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param   Iterable $options
95 95
      * @return  AdapterInterface
96 96
      */
97
-    public function setOptions(?Iterable $config=null): AdapterInterface
97
+    public function setOptions(? Iterable $config = null) : AdapterInterface
98 98
     {
99 99
         if ($config === null) {
100 100
             return $this;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 break;
108 108
                
109 109
                 case 'level':
110
-                    if(!is_numeric($val)) {
110
+                    if (!is_numeric($val)) {
111 111
                         throw new Exception\InvalidArgument('log level must be a number');
112 112
                     }
113 113
 
Please login to merge, or discard this patch.
src/Db/Wrapper/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
Please login to merge, or discard this patch.
src/Db/Wrapper/Pdo.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * @param   Iterable $config
79 79
      * @param   Logger   $logger
80 80
      */
81
-    public function __construct(?Iterable $config, Logger $logger)
81
+    public function __construct(? Iterable $config, Logger $logger)
82 82
     {
83 83
         $this->setOptions($config);
84 84
         $this->logger = $logger;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     public function connect(): Pdo
94 94
     {
95 95
         $this->connection = new PdoServer($this->dsn, $this->username, $this->password, $this->options);
96
-        $this->logger->info('connection to db server [' . $this->dsn . '] using pdo was succesful', [
96
+        $this->logger->info('connection to db server ['.$this->dsn.'] using pdo was succesful', [
97 97
             'category' => get_class($this),
98 98
         ]);
99 99
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @param  array $argumnets
109 109
      * @return mixed
110 110
      */
111
-    public function __call(string $method, array $arguments=[])
111
+    public function __call(string $method, array $arguments = [])
112 112
     {
113 113
         return call_user_func_array([&$this->connection, $method], $arguments);
114 114
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      * @param  Iterable $config
121 121
      * @return Pdo
122 122
      */
123
-    public function setOptions(?Iterable $config = null): Pdo
123
+    public function setOptions(? Iterable $config = null) : Pdo
124 124
     {
125 125
         if ($config === null) {
126 126
             return $this;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     $this->password = (string)$value;
139 139
                     break;
140 140
                 case 'options':
141
-                    foreach($value as $opt => $val) {
141
+                    foreach ($value as $opt => $val) {
142 142
                         $this->options[$opt] = (string)$val;
143 143
                     }
144 144
                     break;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $link   = $this->getResource();
180 180
         $result = $link->query($query);
181 181
 
182
-        if($result === false) {
182
+        if ($result === false) {
183 183
             throw new Exception('failed to execute sql query with error '.$link->errorInfo()[2].' ('.$link->errorCode().')');
184 184
         }
185 185
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $link   = $this->getResource();
203 203
         $result = $link->exec($query);
204 204
 
205
-        if($result === false) {
205
+        if ($result === false) {
206 206
             throw new Exception('failed to execute sql query with error '.$link->errorInfo().' ('.$link->errorCode().')');
207 207
         } else {
208 208
             $this->logger->debug('sql query affected ['.$result.'] rows', [
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
         $link  = $this->getResource();
232 232
         $stmt  = $link->prepare($query);
233 233
 
234
-        if(!($stmt instanceof mysqli_stmt)) {
234
+        if (!($stmt instanceof mysqli_stmt)) {
235 235
             throw new Exception('failed to prepare mysql query with error '.$link->error.' ('.$link->errno.')');
236 236
         }
237 237
 
238 238
         $types = '';
239
-        foreach($values as $attr => $value) {
239
+        foreach ($values as $attr => $value) {
240 240
             $types .= 's';
241 241
         }
242 242
 
Please login to merge, or discard this patch.
src/Db/Wrapper/Mysql.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * @param   Iterable $config
97 97
      * @param   Logger   $logger
98 98
      */
99
-    public function __construct(?Iterable $config, Logger $logger)
99
+    public function __construct(? Iterable $config, Logger $logger)
100 100
     {
101 101
         $this->setOptions($config);
102 102
         $this->logger = $logger;
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
         $this->connection->set_charset($this->charset);
115 115
 
116 116
         if (!$this->connection->connect_errno) {
117
-            $this->logger->info('connection to mysql server [' . $this->host . '] was succesful', [
117
+            $this->logger->info('connection to mysql server ['.$this->host.'] was succesful', [
118 118
                 'category' => get_class($this),
119 119
             ]);
120 120
         } else {
121
-            throw new Exception('failed to connect to mysql server, error: ' .  $this->connection->connect_error.' ('.$this->connection->connect_errno.')');
121
+            throw new Exception('failed to connect to mysql server, error: '.$this->connection->connect_error.' ('.$this->connection->connect_errno.')');
122 122
         }
123 123
 
124 124
         return $this;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * @param  array $argumnets
133 133
      * @return mixed
134 134
      */
135
-    public function __call(string $method, array $arguments=[])
135
+    public function __call(string $method, array $arguments = [])
136 136
     {
137 137
         return call_user_func_array([&$this->connection, $method], $arguments);
138 138
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      * @param  Iterable $config
145 145
      * @return Mysql
146 146
      */
147
-    public function setOptions(?Iterable $config = null): Mysql
147
+    public function setOptions(? Iterable $config = null) : Mysql
148 148
     {
149 149
         if ($config === null) {
150 150
             return $this;
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         $link   = $this->getResource();
208 208
         $result = $link->query($query);
209 209
 
210
-        if($result === false) {
210
+        if ($result === false) {
211 211
             throw new Exception('failed to execute sql query with error '.$link->error.' ('.$link->errno.')');
212 212
         }
213 213
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $link   = $this->getResource();
231 231
         $result = $link->query($query);
232 232
 
233
-        if($result === false) {
233
+        if ($result === false) {
234 234
             throw new Exception('failed to execute sql query with error '.$link->error.' ('.$link->errno.')');
235 235
         }
236 236
 
@@ -255,19 +255,19 @@  discard block
 block discarded – undo
255 255
         $link  = $this->getResource();
256 256
         $stmt  = $link->prepare($query);
257 257
 
258
-        if(!($stmt instanceof mysqli_stmt)) {
258
+        if (!($stmt instanceof mysqli_stmt)) {
259 259
             throw new Exception('failed to prepare sql query with error '.$link->error.' ('.$link->errno.')');
260 260
         }
261 261
 
262 262
         $types = '';
263
-        foreach($values as $attr => $value) {
263
+        foreach ($values as $attr => $value) {
264 264
             $types .= 's';
265 265
         }
266 266
 
267 267
         $stmt->bind_param($types, ...$values);
268 268
         $stmt->execute();
269 269
 
270
-        if($stmt->error) {
270
+        if ($stmt->error) {
271 271
             throw new Exception($stmt->error);
272 272
         }
273 273
         
Please login to merge, or discard this patch.
src/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
Please login to merge, or discard this patch.
src/Config/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
Please login to merge, or discard this patch.
src/Config/Xml.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param   string $env
31 31
      * @return  void
32 32
      */
33
-    public function __construct(string $config, string $env='production')
33
+    public function __construct(string $config, string $env = 'production')
34 34
     {
35 35
         $config = simplexml_load_file($config);
36 36
         if ($this->store === false) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             while (list(, $node) = each($result)) {
50 50
                 $path = (string)$node->attributes()->inherits;
51 51
 
52
-                if($path === '') {
52
+                if ($path === '') {
53 53
                     continue;
54 54
                 }
55 55
 
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
      * @param   bool $replace
87 87
      * @return  bool
88 88
      */
89
-    protected function appendSimplexml(SimpleXMLElement &$simplexml_to, SimpleXMLElement &$simplexml_from, bool $replace=true): bool
89
+    protected function appendSimplexml(SimpleXMLElement&$simplexml_to, SimpleXMLElement&$simplexml_from, bool $replace = true): bool
90 90
     {
91
-        if(count($simplexml_from->children()) === 0) {
92
-            if($replace === true && count($simplexml_to->children()) === 0) {
91
+        if (count($simplexml_from->children()) === 0) {
92
+            if ($replace === true && count($simplexml_to->children()) === 0) {
93 93
                 $simplexml_to[0] = htmlspecialchars((string)$simplexml_from);
94 94
             }
95 95
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         foreach ($simplexml_from->attributes() as $attr_key => $attr_value) {
99 99
             if (!isset($attrs[$attr_key])) {
100 100
                 $simplexml_to->addAttribute($attr_key, (string)$attr_value);
101
-            } elseif($replace===true) {
101
+            } elseif ($replace === true) {
102 102
                 $simplexml_to->attributes()->{$attr_key} = (string)$attr_value;
103 103
             }
104 104
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             if (count($simplexml_child->children()) === 0) {
108 108
                 if (!isset($simplexml_to->{$simplexml_child->getName()})) {
109 109
                     $simplexml_to->addChild($simplexml_child->getName(), htmlspecialchars((string)$simplexml_child));
110
-                } elseif($replace === true && count($simplexml_to->{$simplexml_child->getName()}->children()) === 0) {
110
+                } elseif ($replace === true && count($simplexml_to->{$simplexml_child->getName()}->children()) === 0) {
111 111
                    $simplexml_to->{$simplexml_child->getName()} = htmlspecialchars((string)$simplexml_child);
112 112
                 }
113 113
             } else {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             foreach ($simplexml_child->attributes() as $attr_key => $attr_value) {
119 119
                 if (!isset($attrs[$attr_key])) {
120 120
                     $simplexml_to->{$simplexml_child->getName()}->addAttribute($attr_key, (string)$attr_value);
121
-                } elseif($replace===true) {
121
+                } elseif ($replace === true) {
122 122
                     $simplexml_to->{$simplexml_child->getName()}->attributes()->{$attr_key} = (string)$attr_value;
123 123
                 }
124 124
             }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         while (list(, $node) = each($result)) {
167 167
             $path = (string)$node->attributes()->reference;
168 168
             
169
-            if($path === '') {
169
+            if ($path === '') {
170 170
                 continue;
171 171
             }
172 172
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      * @param   SimpleXMLElement $xml
191 191
      * @return  Config
192 192
      */
193
-    public function map($xml=null): Config
193
+    public function map($xml = null): Config
194 194
     {
195 195
         if ($xml === null) {
196 196
             $xml = $this->store;
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
         foreach ($xml->getNamespaces() + array(null) as $prefix => $namespace) {
201 201
             foreach ($xml->attributes($namespace) as $key => $value) {
202 202
                 if (is_string($prefix)) {
203
-                    $key = $prefix . '.' . $key;
203
+                    $key = $prefix.'.'.$key;
204 204
                 }
205 205
 
206
-                if($key === 'reference') {
206
+                if ($key === 'reference') {
207 207
                     continue;
208 208
                 }
209 209
 
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
                 if (!isset($arr[$name])) {
218 218
                     $config[$name] = $value;
219 219
                 } else {
220
-                    foreach ((array) $value as $k => $v) {
220
+                    foreach ((array)$value as $k => $v) {
221 221
                         if (is_numeric($k)) {
222 222
                             $config[$name][] = $v;
223 223
                         } else {
224 224
                             $config[$name][$k] = array_merge(
225
-                                (array) $config[$name][$k],
226
-                                (array) $v
225
+                                (array)$config[$name][$k],
226
+                                (array)$v
227 227
                             );
228 228
                         }
229 229
                     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 $config[$name] = new Config();
233 233
             }
234 234
         }
235
-        if ($content = trim((string) $xml)) {
235
+        if ($content = trim((string)$xml)) {
236 236
             $config[] = $content;
237 237
         }
238 238
 
Please login to merge, or discard this patch.
src/Config/ConfigInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
@@ -56,5 +56,5 @@  discard block
 block discarded – undo
56 56
      * @param   mixed $config
57 57
      * @return  Config
58 58
      */
59
-    public function map($native=null): Config;
59
+    public function map($native = null): Config;
60 60
 }
Please login to merge, or discard this patch.
src/Api/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Micro
Please login to merge, or discard this patch.