Completed
Pull Request — master (#130)
by
unknown
16:25
created
src/StaticArrayy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         }
43 43
 
44 44
         if (!isset(static::$methodArgs[$name])) {
45
-            throw new \BadMethodCallException($name . ' is not a valid method');
45
+            throw new \BadMethodCallException($name.' is not a valid method');
46 46
         }
47 47
 
48 48
         $numArgs = \count($arguments);
Please login to merge, or discard this patch.
src/TypeCheck/AbstractTypeCheck.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,11 +111,11 @@
 block discarded – undo
111 111
 
112 112
         // resource
113 113
         if (\is_resource($value)) {
114
-            return \get_resource_type($value) . ' resource #' . (int) $value;
114
+            return \get_resource_type($value).' resource #'.(int) $value;
115 115
         }
116 116
 
117 117
         if (\is_object($value)) {
118
-            return \get_class($value) . ' Object';
118
+            return \get_class($value).' Object';
119 119
         }
120 120
 
121 121
         return '';
Please login to merge, or discard this patch.
src/TypeCheck/TypeCheckSimple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function throwException($expectedTypes, $value, $type): \Throwable
28 28
     {
29
-        throw new \TypeError("Invalid type: expected to be of type {{$expectedTypes}}, instead got value `" . \print_r($value, true) . "` with type {{$type}}.");
29
+        throw new \TypeError("Invalid type: expected to be of type {{$expectedTypes}}, instead got value `".\print_r($value, true)."` with type {{$type}}.");
30 30
     }
31 31
 
32 32
     /**
Please login to merge, or discard this patch.
build/generate_docs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../vendor/autoload.php';
4
-require __DIR__ . '/vendor/autoload.php';
3
+require __DIR__.'/../vendor/autoload.php';
4
+require __DIR__.'/vendor/autoload.php';
5 5
 
6 6
 $readmeText = (new \voku\PhpReadmeHelper\GenerateApi())->generate(
7
-    __DIR__ . '/../src/Arrayy.php',
8
-    __DIR__ . '/docs/base.md'
7
+    __DIR__.'/../src/Arrayy.php',
8
+    __DIR__.'/docs/base.md'
9 9
 );
10 10
 
11
-file_put_contents(__DIR__ . '/../README.md', $readmeText);
11
+file_put_contents(__DIR__.'/../README.md', $readmeText);
Please login to merge, or discard this patch.
examples/JsonResponseDataExample.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Arrayy\tests;
4 4
 
5
-require_once __DIR__ . '/../vendor/autoload.php';
5
+require_once __DIR__.'/../vendor/autoload.php';
6 6
 
7 7
 /**
8 8
  * @property string                                $type
Please login to merge, or discard this patch.
src/Mapper/Json.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         if (!\is_object($object)) {
74 74
             throw new \InvalidArgumentException(
75
-                'JsonMapper::map() requires second argument to be an object, ' . \gettype($object) . ' given.'
75
+                'JsonMapper::map() requires second argument to be an object, '.\gettype($object).' given.'
76 76
             );
77 77
         }
78 78
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 $type = $this->removeNullable($type);
122 122
             } elseif ($jsonValue === null) {
123 123
                 throw new \InvalidArgumentException(
124
-                    'JSON property "' . $key . '" in class "' . $strClassName . '" must not be NULL'
124
+                    'JSON property "'.$key.'" in class "'.$strClassName.'" must not be NULL'
125 125
                 );
126 126
             }
127 127
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             if ($this->isSimpleType($type)) {
149 149
                 if ($type === 'string' && \is_object($jsonValue)) {
150 150
                     throw new \InvalidArgumentException(
151
-                        'JSON property "' . $key . '" in class "' . $strClassName . '" is an object and cannot be converted to a string'
151
+                        'JSON property "'.$key.'" in class "'.$strClassName.'" is an object and cannot be converted to a string'
152 152
                     );
153 153
                 }
154 154
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
             if ($type === '') {
171 171
                 throw new \InvalidArgumentException(
172
-                    'Empty type at property "' . $strClassName . '::$' . $key . '"'
172
+                    'Empty type at property "'.$strClassName.'::$'.$key.'"'
173 173
                 );
174 174
             }
175 175
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                     $this->isScalarType(\gettype($jsonValue))
204 204
                 ) {
205 205
                     throw new \InvalidArgumentException(
206
-                        'JSON property "' . $key . '" must be an array, ' . \gettype($jsonValue) . ' given'
206
+                        'JSON property "'.$key.'" must be an array, '.\gettype($jsonValue).' given'
207 207
                     );
208 208
                 }
209 209
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 }
304 304
             } elseif ($this->isScalarType($class)) {
305 305
                 throw new \InvalidArgumentException(
306
-                    'JSON property "' . ($parent_key ?: '?') . '" is an array of type "' . $class . '" but contained a value of type "' . \gettype($jsonValue) . '"'
306
+                    'JSON property "'.($parent_key ?: '?').'" is an array of type "'.$class.'" but contained a value of type "'.\gettype($jsonValue).'"'
307 307
                 );
308 308
             } elseif (\is_a($class, \ArrayObject::class, true)) {
309 309
                 /** @noinspection PhpSillyAssignmentInspection - phpstan helper */
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         }
360 360
 
361 361
         //create a full qualified namespace
362
-        return '\\' . $strNs . '\\' . $type;
362
+        return '\\'.$strNs.'\\'.$type;
363 363
     }
364 364
 
365 365
     /**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
      */
664 664
     private function isNullable($type): bool
665 665
     {
666
-        return \stripos('|' . $type . '|', '|null|') !== false;
666
+        return \stripos('|'.$type.'|', '|null|') !== false;
667 667
     }
668 668
 
669 669
     /**
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
         }
681 681
 
682 682
         return \substr(
683
-            \str_ireplace('|null|', '|', '|' . $type . '|'),
683
+            \str_ireplace('|null|', '|', '|'.$type.'|'),
684 684
             1,
685 685
             -1
686 686
         );
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
             $constructor->getNumberOfRequiredParameters() > 0
729 729
         ) {
730 730
             /** @phpstan-var TClass $return */
731
-            $return =  $reflectClass->newInstanceWithoutConstructor();
731
+            $return = $reflectClass->newInstanceWithoutConstructor();
732 732
         } else {
733 733
             /** @phpstan-var TClass $return */
734 734
             $return = $reflectClass->newInstance();
Please login to merge, or discard this patch.
src/TypeCheck/TypeCheckCallback.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,6 +67,6 @@
 block discarded – undo
67 67
      */
68 68
     public function throwException($expectedTypes, $value, $type): \Throwable
69 69
     {
70
-        throw new \TypeError('Invalid type: callable failed, got value `' . \print_r($value, true) . "` with type {{$type}}.");
70
+        throw new \TypeError('Invalid type: callable failed, got value `'.\print_r($value, true)."` with type {{$type}}.");
71 71
     }
72 72
 }
Please login to merge, or discard this patch.
src/Type/NumericStringCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $return = TypeCheckArray::create(
25 25
             [
26 26
                 Arrayy::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES => new TypeCheckCallback(
27
-                    static function ($value) {
27
+                    static function($value) {
28 28
                         return \is_string($value) && \is_numeric($value);
29 29
                     }
30 30
                 ),
Please login to merge, or discard this patch.
src/Type/NumericCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $return = TypeCheckArray::create(
25 25
             [
26 26
                 Arrayy::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES => new TypeCheckCallback(
27
-                    static function ($value) {
27
+                    static function($value) {
28 28
                         return \is_numeric($value);
29 29
                     }
30 30
                 ),
Please login to merge, or discard this patch.