@@ -4,19 +4,19 @@ |
||
4 | 4 | |
5 | 5 | localhost(); |
6 | 6 | |
7 | -task('named_arguments', function () { |
|
7 | +task('named_arguments', function() { |
|
8 | 8 | run('echo "Hello, $name!"', env: ['name' => 'world']); |
9 | 9 | }); |
10 | 10 | |
11 | -task('options', function () { |
|
11 | +task('options', function() { |
|
12 | 12 | run('echo "Hello, $name!"', ['env' => ['name' => 'Anton']]); |
13 | 13 | }); |
14 | 14 | |
15 | -task('options_with_named_arguments', function () { |
|
15 | +task('options_with_named_arguments', function() { |
|
16 | 16 | // The `options:` arg has higher priority than named arguments. |
17 | 17 | run('echo "Hello, $name!"', ['env' => ['name' => 'override']], env: ['name' => 'world']); |
18 | 18 | }); |
19 | 19 | |
20 | -task('run_locally_named_arguments', function () { |
|
20 | +task('run_locally_named_arguments', function() { |
|
21 | 21 | runLocally('echo "Hello, $name!"', env: ['name' => 'world']); |
22 | 22 | }); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | if (!headers_sent()) { |
7 | 7 | header('HTTP/1.1 500 Internal Server Error'); |
8 | 8 | } |
9 | - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; |
|
9 | + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running ' . PHP_VERSION . ', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.' . PHP_EOL; |
|
10 | 10 | if (!ini_get('display_errors')) { |
11 | 11 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
12 | 12 | fwrite(STDERR, $err); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @param string $constraint the constraint/rule that is broken, e.g.: 'minLength' |
41 | 41 | * @param array $more more array elements to add to the error |
42 | 42 | */ |
43 | - public function addError(?JsonPointer $path, $message, $constraint='', ?array $more = null); |
|
43 | + public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * checks if the validator has not raised errors |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | { |
22 | 22 | protected $inlineSchemaProperty = '$schema'; |
23 | 23 | |
24 | - const CHECK_MODE_NONE = 0x00000000; |
|
25 | - const CHECK_MODE_NORMAL = 0x00000001; |
|
26 | - const CHECK_MODE_TYPE_CAST = 0x00000002; |
|
27 | - const CHECK_MODE_COERCE_TYPES = 0x00000004; |
|
28 | - const CHECK_MODE_APPLY_DEFAULTS = 0x00000008; |
|
29 | - const CHECK_MODE_EXCEPTIONS = 0x00000010; |
|
30 | - const CHECK_MODE_DISABLE_FORMAT = 0x00000020; |
|
31 | - const CHECK_MODE_ONLY_REQUIRED_DEFAULTS = 0x00000080; |
|
32 | - const CHECK_MODE_VALIDATE_SCHEMA = 0x00000100; |
|
24 | + const CHECK_MODE_NONE = 0x00000000; |
|
25 | + const CHECK_MODE_NORMAL = 0x00000001; |
|
26 | + const CHECK_MODE_TYPE_CAST = 0x00000002; |
|
27 | + const CHECK_MODE_COERCE_TYPES = 0x00000004; |
|
28 | + const CHECK_MODE_APPLY_DEFAULTS = 0x00000008; |
|
29 | + const CHECK_MODE_EXCEPTIONS = 0x00000010; |
|
30 | + const CHECK_MODE_DISABLE_FORMAT = 0x00000020; |
|
31 | + const CHECK_MODE_ONLY_REQUIRED_DEFAULTS = 0x00000080; |
|
32 | + const CHECK_MODE_VALIDATE_SCHEMA = 0x00000100; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Bubble down the path |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | protected function convertJsonPointerIntoPropertyPath(JsonPointer $pointer) |
208 | 208 | { |
209 | 209 | $result = array_map( |
210 | - function ($path) { |
|
210 | + function($path) { |
|
211 | 211 | return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path); |
212 | 212 | }, |
213 | 213 | $pointer->getPropertyPaths() |
@@ -38,7 +38,7 @@ |
||
38 | 38 | if (isset($schema->uniqueItems) && $schema->uniqueItems) { |
39 | 39 | $unique = $value; |
40 | 40 | if (is_array($value) && count($value)) { |
41 | - $unique = array_map(function ($e) { |
|
41 | + $unique = array_map(function($e) { |
|
42 | 42 | return var_export($e, true); |
43 | 43 | }, $value); |
44 | 44 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if ($errors) { |
71 | 71 | $this->errors = array_merge($this->errors, $errors); |
72 | 72 | $errorMask = &$this->errorMask; |
73 | - array_walk($errors, function ($error) use (&$errorMask) { |
|
73 | + array_walk($errors, function($error) use (&$errorMask) { |
|
74 | 74 | if (isset($error['context'])) { |
75 | 75 | $errorMask |= $error['context']; |
76 | 76 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return $this->errors; |
85 | 85 | } |
86 | 86 | |
87 | - return array_filter($this->errors, function ($error) use ($errorContext) { |
|
87 | + return array_filter($this->errors, function($error) use ($errorContext) { |
|
88 | 88 | if ($errorContext & $error['context']) { |
89 | 89 | return true; |
90 | 90 | } |
@@ -273,8 +273,8 @@ |
||
273 | 273 | public function generate(array $components) |
274 | 274 | { |
275 | 275 | $uri = $components['scheme'] . '://' |
276 | - . $components['authority'] |
|
277 | - . $components['path']; |
|
276 | + . $components['authority'] |
|
277 | + . $components['path']; |
|
278 | 278 | |
279 | 279 | if (array_key_exists('query', $components)) { |
280 | 280 | $uri .= $components['query']; |
@@ -245,7 +245,7 @@ |
||
245 | 245 | |
246 | 246 | $components = array(); |
247 | 247 | if (5 < count($match)) { |
248 | - $components = array( |
|
248 | + $components = array( |
|
249 | 249 | 'scheme' => $match[2], |
250 | 250 | 'authority' => $match[4], |
251 | 251 | 'path' => $match[5] |
@@ -58,8 +58,8 @@ |
||
58 | 58 | public function generate(array $components) |
59 | 59 | { |
60 | 60 | $uri = $components['scheme'] . '://' |
61 | - . $components['authority'] |
|
62 | - . $components['path']; |
|
61 | + . $components['authority'] |
|
62 | + . $components['path']; |
|
63 | 63 | |
64 | 64 | if (array_key_exists('query', $components) && strlen($components['query'])) { |
65 | 65 | $uri .= '?' . $components['query']; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $components = array(); |
34 | 34 | if (5 < count($match)) { |
35 | - $components = array( |
|
35 | + $components = array( |
|
36 | 36 | 'scheme' => $match[2], |
37 | 37 | 'authority' => $match[4], |
38 | 38 | 'path' => $match[5] |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $basePathSegments = explode('/', $basePath); |
136 | 136 | |
137 | 137 | preg_match('|^/?(\.\./(?:\./)*)*|', $relativePath, $match); |
138 | - $numLevelUp = strlen($match[0]) /3 + 1; |
|
138 | + $numLevelUp = strlen($match[0]) / 3 + 1; |
|
139 | 139 | if ($numLevelUp >= count($basePathSegments)) { |
140 | 140 | throw new UriResolverException(sprintf("Unable to resolve URI '%s' from base '%s'", $relativePath, $basePath)); |
141 | 141 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | public function retrieve($uri) |
29 | 29 | { |
30 | 30 | $errorMessage = null; |
31 | - set_error_handler(function ($errno, $errstr) use (&$errorMessage) { |
|
31 | + set_error_handler(function($errno, $errstr) use (&$errorMessage) { |
|
32 | 32 | $errorMessage = $errstr; |
33 | 33 | }); |
34 | 34 | $response = file_get_contents($uri); |