Completed
Push — master ( 9a0752...0003b1 )
by Stéphane
8s
created
src/Walker.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -157,6 +157,9 @@
 block discarded – undo
157 157
         }
158 158
     }
159 159
 
160
+    /**
161
+     * @param stdClass $item
162
+     */
160 163
     private function isLooping($item, array &$stack)
161 164
     {
162 165
         $isKnown = false;
Please login to merge, or discard this patch.
bin/jval.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 require_once __DIR__.'/../vendor/autoload.php';
11 11
 
12
-set_error_handler(function ($severity, $message, $file, $line) {
12
+set_error_handler(function($severity, $message, $file, $line) {
13 13
     throw new ErrorException($message, 0, $severity, $file, $line);
14 14
 });
15 15
 
@@ -49,10 +49,9 @@  discard block
 block discarded – undo
49 49
     $schema = JVal\Utils::loadJsonFromFile($schemaFile[1]);
50 50
     $validator = JVal\Validator::buildDefault();
51 51
     $errors = $validator->validate($instance, $schema, $schemaUri);
52
-    echo json_encode($errors, JSON_PRETTY_PRINT) . "\n";
52
+    echo json_encode($errors, JSON_PRETTY_PRINT)."\n";
53 53
     ($count = count($errors)) > 0 ?
54
-        writeln("{$count} errors.", 'error') :
55
-        writeln('No error.', 'info');
54
+        writeln("{$count} errors.", 'error') : writeln('No error.', 'info');
56 55
 } catch (Exception $ex) {
57 56
     writeln($ex->getMessage(), 'error');
58 57
     writeln($ex->getTraceAsString());
Please login to merge, or discard this patch.
src/Testing/ConstraintTestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
                             $set->instance,
115 115
                             $test->schema,
116 116
                             false,
117
-                            array_map(function ($violation) {
117
+                            array_map(function($violation) {
118 118
                                 return (array) $violation;
119 119
                             }, $set->violations),
120 120
                         ];
Please login to merge, or discard this patch.
src/Constraint/MultipleOfConstraint.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,11 +70,9 @@
 block discarded – undo
70 70
             $fMod = 0.0;
71 71
         } else {
72 72
             $decimals1 = mb_strpos($instance, '.') ?
73
-                mb_strlen($instance) - mb_strpos($instance, '.') - 1 :
74
-                0;
73
+                mb_strlen($instance) - mb_strpos($instance, '.') - 1 : 0;
75 74
             $decimals2 = mb_strpos($divider, '.') ?
76
-                mb_strlen($divider) - mb_strpos($divider, '.') - 1 :
77
-                0;
75
+                mb_strlen($divider) - mb_strpos($divider, '.') - 1 : 0;
78 76
             $fMod = (float) round($modulus, max($decimals1, $decimals2));
79 77
         }
80 78
 
Please login to merge, or discard this patch.
src/Constraint/MaxLengthConstraint.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
     public function apply($instance, stdClass $schema, Context $context, Walker $walker)
42 42
     {
43 43
         $length = extension_loaded('mbstring') ?
44
-            mb_strlen($instance, mb_detect_encoding($instance)) :
45
-            strlen($instance);
44
+            mb_strlen($instance, mb_detect_encoding($instance)) : strlen($instance);
46 45
 
47 46
         if ($length > $schema->maxLength) {
48 47
             $context->addViolation(
Please login to merge, or discard this patch.
src/Resolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@
 block discarded – undo
226 226
             $uri = $hook($uri);
227 227
         }
228 228
 
229
-        set_error_handler(function ($severity, $error) use ($uri) {
229
+        set_error_handler(function($severity, $error) use ($uri) {
230 230
             restore_error_handler();
231 231
             throw new UnfetchableUriException([$uri, $error, $severity]);
232 232
         });
Please login to merge, or discard this patch.
src/Registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
     private function createConstraints(array $constraintNames)
110 110
     {
111
-        return array_map(function ($name) {
111
+        return array_map(function($name) {
112 112
             $class = "JVal\\Constraint\\{$name}Constraint";
113 113
 
114 114
             return new $class();
Please login to merge, or discard this patch.
src/Utils.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,9 +91,9 @@
 block discarded – undo
91 91
 
92 92
         if (json_last_error() !== JSON_ERROR_NONE) {
93 93
             throw new JsonDecodeException(sprintf(
94
-               'Cannot decode JSON from file "%s" (error: %s)',
95
-               $filePath,
96
-               static::lastJsonErrorMessage()
94
+                'Cannot decode JSON from file "%s" (error: %s)',
95
+                $filePath,
96
+                static::lastJsonErrorMessage()
97 97
             ));
98 98
         }
99 99
 
Please login to merge, or discard this patch.
src/Constraint/MinLengthConstraint.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
     public function apply($instance, stdClass $schema, Context $context, Walker $walker)
42 42
     {
43 43
         $length = extension_loaded('mbstring') ?
44
-            mb_strlen($instance, mb_detect_encoding($instance)) :
45
-            strlen($instance);
44
+            mb_strlen($instance, mb_detect_encoding($instance)) : strlen($instance);
46 45
 
47 46
         if ($length > $schema->maxLength) {
48 47
             $context->addViolation(
Please login to merge, or discard this patch.