@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | private function bootInheritance(\SplStack $stack, array $children = []): void |
80 | 80 | { |
81 | - $push = function (string $type) use ($stack): void { |
|
81 | + $push = function(string $type) use ($stack): void { |
|
82 | 82 | self::$inheritance[$type] = \array_values(\iterator_to_array($stack)); |
83 | 83 | self::$inheritance[$type][] = static::ROOT_TYPE; |
84 | 84 |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | { |
80 | 80 | $skipNullable = $this->skip === static::SKIP_NULL && $value === null; |
81 | 81 | |
82 | - $skipEmpty = $this->skip === static::SKIP_EMPTY && ! $value; |
|
82 | + $skipEmpty = $this->skip === static::SKIP_EMPTY && !$value; |
|
83 | 83 | |
84 | - if (! $skipEmpty && ! $skipNullable) { |
|
84 | + if (!$skipEmpty && !$skipNullable) { |
|
85 | 85 | $this->attributes[$key ?? \count($this->attributes)] = |
86 | 86 | \is_iterable($value) ? new self($value) : $value; |
87 | 87 | } |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function jsonSerialize() |
141 | 141 | { |
142 | - $applicator = function ($value) { |
|
142 | + $applicator = function($value) { |
|
143 | 143 | if (\is_object($value) && \method_exists($value, '__toString')) { |
144 | - return (string)$value; |
|
144 | + return (string) $value; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $value; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function toJson(int $options = 0): string |
160 | 160 | { |
161 | - return (string)\json_encode($this->jsonSerialize(), $options); |
|
161 | + return (string) \json_encode($this->jsonSerialize(), $options); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function compile(Readable $file): DocumentInterface |
101 | 101 | { |
102 | - return $this->store->memoize($file, function (Readable $file): DocumentInterface { |
|
102 | + return $this->store->memoize($file, function(Readable $file): DocumentInterface { |
|
103 | 103 | return $this->generate($file, $this->ir($file)); |
104 | 104 | }); |
105 | 105 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function generate(Readable $file, iterable $ir): DocumentInterface |
114 | 114 | { |
115 | - return $this->wrap(function () use ($file, $ir) { |
|
115 | + return $this->wrap(function() use ($file, $ir) { |
|
116 | 116 | return $this->back->run($file, $ir); |
117 | 117 | }); |
118 | 118 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function ir(Readable $readable): iterable |
147 | 147 | { |
148 | - return $this->wrap(function () use ($readable) { |
|
148 | + return $this->wrap(function() use ($readable) { |
|
149 | 149 | return $this->front->load($readable); |
150 | 150 | }); |
151 | 151 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/sdl/grammar.pp2'; |
|
24 | + private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/sdl/grammar.pp2'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @var string |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | Compiler::load(File::fromPathname(self::SCHEMA_SDL_GRAMMAR)) |
44 | 44 | ->setClassName('Parser') |
45 | 45 | ->setNamespace('Railt\\SDL\\Frontend') |
46 | - ->saveTo(__DIR__ . '/../Frontend'); |
|
46 | + ->saveTo(__DIR__.'/../Frontend'); |
|
47 | 47 | |
48 | 48 | $this->info('OK'); |
49 | 49 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | |
68 | 68 | default: |
69 | 69 | throw new InternalException( |
70 | - 'Unrecognized struct ' . $value->toJson(\JSON_PRETTY_PRINT) |
|
70 | + 'Unrecognized struct '.$value->toJson(\JSON_PRETTY_PRINT) |
|
71 | 71 | ); |
72 | 72 | } |
73 | 73 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @var string |
26 | 26 | */ |
27 | - public const RAILT_SDL_1_2 = __DIR__ . '/../../resources/rlsdl-1.2.json'; |
|
27 | + public const RAILT_SDL_1_2 = __DIR__.'/../../resources/rlsdl-1.2.json'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @var string |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $this->validator->reset(); |
75 | 75 | $this->validator->validate($json, $this->schema, Constraint::CHECK_MODE_VALIDATE_SCHEMA); |
76 | 76 | |
77 | - if (! $this->validator->isValid()) { |
|
77 | + if (!$this->validator->isValid()) { |
|
78 | 78 | $error = \implode(\PHP_EOL, [ |
79 | 79 | 'An internal representation code errors was found: ', |
80 | 80 | $this->errorsToString($this->validator->getErrors()) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | private function errorsToString(array $errors): string |
94 | 94 | { |
95 | - $applicator = function (array $error): string { |
|
95 | + $applicator = function(array $error): string { |
|
96 | 96 | if ($error['property']) { |
97 | 97 | return \sprintf(' - [%s] %s.', $error['property'], $error['message']); |
98 | 98 | } |