Passed
Push — master ( 17aaee...b9fd01 )
by Misha
02:19
created
src/DataBag.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         if (!is_numeric($index)) {
124 124
             $target = $index;
125 125
             $index = null;
126
-            foreach ((array)$nodes as $nodeIndex => $node) {
126
+            foreach ((array) $nodes as $nodeIndex => $node) {
127 127
                 if ($node['type'] === $target) {
128 128
                     $index = $nodeIndex;
129 129
                     break;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function get($path, $default = null)
159 159
     {
160
-        $path = (string)$path;
160
+        $path = (string) $path;
161 161
         $this->guardAgainstInvalidPath($path);
162 162
 
163 163
         if (!array_key_exists($path, $this->cache)) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function set($path, $value)
178 178
     {
179
-        $path = (string)$path;
179
+        $path = (string) $path;
180 180
         $this->guardAgainstInvalidPath($path);
181 181
 
182 182
         unset($this->cache[$path]);
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             }
209 209
             $index = null;
210 210
             if (isset($this->data[$entityType][$path])) {
211
-                foreach ((array)$this->data[$entityType][$path] as $nodeIndex => $node) {
211
+                foreach ((array) $this->data[$entityType][$path] as $nodeIndex => $node) {
212 212
                     if ($node['type'] === $target) {
213 213
                         $index = $nodeIndex;
214 214
                         break;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function remove($path, $removeAll = true)
265 265
     {
266
-        $path = (string)$path;
266
+        $path = (string) $path;
267 267
         $this->guardAgainstInvalidPath($path);
268 268
 
269 269
         list($entityType, $path) = explode('.', $path, 2);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         }
296 296
 
297 297
         if (is_numeric($index)) {
298
-            $index = (int)$index;
298
+            $index = (int) $index;
299 299
             if ($removeAll) {
300 300
                 // Remove all (higher) values to prevent a new value after re-indexing
301 301
                 if ($index === 0) {
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             // Filter out all nodes of the specified type
311 311
             $this->data[$entityType][$path] = array_filter(
312 312
                 $this->data[$entityType][$path],
313
-                static function ($node) use ($index) {
313
+                static function($node) use ($index) {
314 314
                     return empty($node['type']) || $node['type'] !== $index;
315 315
                 }
316 316
             );
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             || substr($path, -1) === '.' // ends with .
370 370
             || in_array(strpos($path, '.'), [false, 0], true) // starts with or doesnt have any .
371 371
         ) {
372
-            throw new InvalidDataBagPathException('Invalid path provided: ' . $path);
372
+            throw new InvalidDataBagPathException('Invalid path provided: '.$path);
373 373
         }
374 374
     }
375 375
 
Please login to merge, or discard this patch.