Completed
Push — master ( 5af3ff...82b6bc )
by Boy
01:56
created
src/CMPayments/Json/Json.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@
 block discarded – undo
209 209
      * Does the actual decoding of a JSON string
210 210
      *
211 211
      * @param      $data
212
-     * @param      $type
212
+     * @param      string $type
213 213
      * @param bool $assoc
214 214
      *
215 215
      * @return mixed
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
         if ($type === self::SCHEMA) {
182 182
 
183 183
             // calculate and set filename
184
-            $cache->setFilename(md5($data) . '.php');
184
+            $cache->setFilename(md5($data).'.php');
185 185
 
186 186
             // if cache file exits it means that this Schema has been correctly validated before
187 187
             if (file_exists($cache->getAbsoluteFilePath())) {
Please login to merge, or discard this patch.
src/CMPayments/SchemaValidator/SchemaValidator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -371,7 +371,7 @@
 block discarded – undo
371 371
      *
372 372
      * @param            string[] $input
373 373
      * @param            $schema
374
-     * @param            $path
374
+     * @param            string $path
375 375
      * @param bool|false $mandatory
376 376
      *
377 377
      * @return mixed
Please login to merge, or discard this 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
         $filename = $cache->getFilename();
68 68
         if (empty($filename)) {
69 69
 
70
-            $cache->setFilename(md5(json_encode($schema)) . '.php');
70
+            $cache->setFilename(md5(json_encode($schema)).'.php');
71 71
         }
72 72
 
73 73
         // if cache file exists, require it, if not, validate the schema
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     || (!isset($schema->additionalProperties) && (isset($this->rootSchema->additionalProperties) && !$this->rootSchema->additionalProperties))
150 150
                 ) {
151 151
                     // $schema->additionalProperties says NO, log that a fields is missing
152
-                    $this->addError(ValidateException::ERROR_USER_DATA_PROPERTY_IS_NOT_AN_ALLOWED_PROPERTY, [$path . '/' . $property]);
152
+                    $this->addError(ValidateException::ERROR_USER_DATA_PROPERTY_IS_NOT_AN_ALLOWED_PROPERTY, [$path.'/'.$property]);
153 153
                 }
154 154
             }
155 155
             // Everything else
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
     public function validate($schema, $property, $data, $path)
173 173
     {
174 174
         // check if the expected $schema->type matches gettype($data)
175
-        $type = $this->validateType($schema, $data, ((substr($path, -1) !== '/') ? $path . '/' . $property : $path . $property));
175
+        $type = $this->validateType($schema, $data, ((substr($path, -1) !== '/') ? $path.'/'.$property : $path.$property));
176 176
 
177 177
         // append /$property to $path
178
-        $path .= (substr($path, 0, 1) !== '/') ? '/' . $property : $property;
178
+        $path .= (substr($path, 0, 1) !== '/') ? '/'.$property : $property;
179 179
 
180 180
         // if $type is an object
181 181
         if ($type === BaseValidator::OBJECT) {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             && ($schema->type === $type)
187 187
         ) { // everything else except boolean
188 188
 
189
-            $method = 'validate' . ucfirst($type);
189
+            $method = 'validate'.ucfirst($type);
190 190
             $this->$method($data, $schema, $path);
191 191
 
192 192
             // check for format property on schema
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
             // check if the given schema is not empty
249 249
             if (empty($schemaPropertiesInArray)) {
250 250
 
251
-                throw new ValidateSchemaException(ValidateSchemaException::ERROR_SCHEMA_CANNOT_BE_EMPTY_IN_PATH, [$path . '/properties']);
251
+                throw new ValidateSchemaException(ValidateSchemaException::ERROR_SCHEMA_CANNOT_BE_EMPTY_IN_PATH, [$path.'/properties']);
252 252
             }
253 253
 
254 254
             foreach ($schema->properties as $property => $childSchema) {
255 255
 
256
-                $subPath = $path . '.properties';
256
+                $subPath = $path.'.properties';
257 257
 
258 258
                 // when an object key is empty it becomes '_empty_' by json_decode(), catch it since this is not valid
259 259
                 if ($property === '_empty_') {
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
                             'Schema',
271 271
                             $this->getPreposition(gettype($childSchema)),
272 272
                             gettype($childSchema),
273
-                            (' in ' . $subPath)
273
+                            (' in '.$subPath)
274 274
                         ]);
275 275
                 }
276 276
 
277 277
                 // do recursion
278
-                $schema->properties->$property = $this->validateSchema($childSchema, ($subPath . '.' . $property));
278
+                $schema->properties->$property = $this->validateSchema($childSchema, ($subPath.'.'.$property));
279 279
             }
280 280
 
281 281
             // check if the optional property 'required' is set on $schema
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         } elseif ($schema->type === BaseValidator::_ARRAY) {
288 288
 
289 289
             // do recursion
290
-            $schema->items = $this->validateSchema($schema->items, ($path . '.items'));
290
+            $schema->items = $this->validateSchema($schema->items, ($path.'.items'));
291 291
         }
292 292
 
293 293
         return $schema;
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      */
503 503
     private function validateSchemaRequiredAgainstProperties($schema, $path)
504 504
     {
505
-        $requiredPath = $path . '.required';
505
+        $requiredPath = $path.'.required';
506 506
 
507 507
         // $schema->required must be an array
508 508
         if (!is_array($schema->required)) {
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 
697 697
                     $data = str_replace("\n", '', $data);
698 698
                     $data = preg_replace("/\r|\n/", '', $data);
699
-                    $data = (strlen($data) < 25) ? $data : substr($data, 0, 25) . ' [...]';
699
+                    $data = (strlen($data) < 25) ? $data : substr($data, 0, 25).' [...]';
700 700
                 }
701 701
 
702 702
                 $params[] = $data;
Please login to merge, or discard this patch.
src/CMPayments/helpers.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
     /**
6 6
      * Converts an \Exception into an array
7 7
      *
8
-     * @param $e
8
+     * @param Exception $e
9 9
      *
10 10
      * @return array
11 11
      * @throws Exception
Please login to merge, or discard this patch.
src/CMPayments/Exception/BaseException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
      *
86 86
      * @return string
87 87
      */
88
-    public static function getClassName(){
88
+    public static function getClassName() {
89 89
 
90 90
         return get_called_class();
91 91
     }
Please login to merge, or discard this patch.
src/CMPayments/Cache/Cache.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function __construct(array $options = [], &$passthru = [])
31 31
     {
32 32
         $defaultOptions = [
33
-            'directory' => __DIR__ . '/../../../storage/cache/',
33
+            'directory' => __DIR__.'/../../../storage/cache/',
34 34
             'debug'     => false
35 35
         ];
36 36
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             throw new CacheException(CacheException::ERROR_CACHE_FILENAME_NOT_SET, ['$options[\'filename\']']);
102 102
         }
103 103
 
104
-        return $this->options['directory'] . $this->options['filename'];
104
+        return $this->options['directory'].$this->options['filename'];
105 105
     }
106 106
 
107 107
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         if ($variable instanceof \stdClass) {
159 159
 
160 160
             // workaround for a PHP bug where var_export cannot deal with stdClass
161
-            $result = '(object) ' . $this->generateRunnableCache(get_object_vars($variable), true);
161
+            $result = '(object) '.$this->generateRunnableCache(get_object_vars($variable), true);
162 162
         } else {
163 163
 
164 164
             if (is_array($variable)) {
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 
167 167
                 foreach ($variable as $key => $value) {
168 168
 
169
-                    $array[] = var_export($key, true) . ' => ' . $this->generateRunnableCache($value, true);
169
+                    $array[] = var_export($key, true).' => '.$this->generateRunnableCache($value, true);
170 170
                 }
171
-                $result = 'array (' . implode(', ', $array) . ')';
171
+                $result = 'array ('.implode(', ', $array).')';
172 172
             } else {
173 173
 
174 174
                 $result = var_export($variable, true);
Please login to merge, or discard this patch.
src/CMPayments/SchemaValidator/Validators/ArrayTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         // Continue checking if every $row in $data matches $schema->items
64 64
         foreach ($data as $property => $row) {
65 65
 
66
-            $this->validate($schema->items, $this->numberToOrdinal($property + 1) . ' child', $row, $path);
66
+            $this->validate($schema->items, $this->numberToOrdinal($property + 1).' child', $row, $path);
67 67
         }
68 68
     }
69 69
 
Please login to merge, or discard this patch.
src/CMPayments/SchemaValidator/Validators/RegexTrait.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
             return;
27 27
         }
28 28
 
29
-        $pattern = '/' . trim($schema->pattern, '/') . '/';
29
+        $pattern = '/'.trim($schema->pattern, '/').'/';
30 30
 
31 31
         if (!in_array($schema->type, [BaseValidator::NUMBER, BaseValidator::STRING]) && !is_scalar($data)) {
32 32
 
Please login to merge, or discard this patch.
src/CMPayments/SchemaValidator/Validators/ErrorTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@
 block discarded – undo
139 139
     {
140 140
         if (in_array(($lastDigit = (int)substr($number, -1)), [1, 2, 3])) {
141 141
 
142
-            return $number . $this->stringifiedOrdinals[$lastDigit];
142
+            return $number.$this->stringifiedOrdinals[$lastDigit];
143 143
         }
144 144
 
145
-        return $number . $this->stringifiedOrdinals[0];
145
+        return $number.$this->stringifiedOrdinals[0];
146 146
     }
147 147
 }
Please login to merge, or discard this patch.
src/CMPayments/SchemaValidator/Exceptions/ValidateSchemaException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,6 +63,6 @@
 block discarded – undo
63 63
      */
64 64
     public function getItemFromVariableArray($code, $default = null, $msgArray = 'messages')
65 65
     {
66
-        return (new \ReflectionClass($this))->getShortName() . ': ' . parent::getItemFromVariableArray($code, $default, $msgArray);
66
+        return (new \ReflectionClass($this))->getShortName().': '.parent::getItemFromVariableArray($code, $default, $msgArray);
67 67
     }
68 68
 }
69 69
\ No newline at end of file
Please login to merge, or discard this patch.