@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public function generate(Readable $file, iterable $records): Document |
| 47 | 47 | { |
| 48 | 48 | foreach ($records as $record) { |
| 49 | - echo __FILE__ . ':' . __LINE__ . "\n"; |
|
| 49 | + echo __FILE__.':'.__LINE__."\n"; |
|
| 50 | 50 | echo \json_encode($record, \JSON_PRETTY_PRINT); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | * @param TypeInterface|null $type |
| 129 | 129 | * @return VarSymbolInterface |
| 130 | 130 | */ |
| 131 | - public function declare(string $var, TypeInterface $type = null): VarSymbolInterface |
|
| 131 | + public function declare(string$var,TypeInterface$type=null): VarSymbolInterface |
|
| 132 | 132 | { |
| 133 | 133 | if ($this->has($var)) { |
| 134 | 134 | $error = 'Can not define var $%s, because %s already has been defined'; |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $arguments = []; |
| 82 | 82 | |
| 83 | 83 | foreach ($this->arguments as $name => $value) { |
| 84 | - $arguments[] = $name . ': ' . $value; |
|
| 84 | + $arguments[] = $name.': '.$value; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return \sprintf('%s<%s>', $this->name->getFullyQualifiedName(), \implode(', ', $arguments)); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | /** @noinspection SuspiciousAssignmentsInspection */ |
| 244 | 244 | $value = $this->store->add($value); |
| 245 | 245 | |
| 246 | - if (! $value->getOffset()) { |
|
| 246 | + if (!$value->getOffset()) { |
|
| 247 | 247 | $value->definedIn($offset); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | private function after(ContextInterface $context): \Generator |
| 270 | 270 | { |
| 271 | - $after = $this->store->extract(function (DeferredInterface $deferred): bool { |
|
| 272 | - return ! $deferred instanceof Identifiable || ! $deferred->getDefinition()->isGeneric(); |
|
| 271 | + $after = $this->store->extract(function(DeferredInterface $deferred): bool { |
|
| 272 | + return !$deferred instanceof Identifiable || !$deferred->getDefinition()->isGeneric(); |
|
| 273 | 273 | }); |
| 274 | 274 | |
| 275 | 275 | foreach ($after as $deferred) { |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | /** @var ValueInterface $value */ |
| 45 | 45 | $value = yield $rule->getChild(0); |
| 46 | 46 | |
| 47 | - if (! $value->getType()->typeOf(Type::string())) { |
|
| 47 | + if (!$value->getType()->typeOf(Type::string())) { |
|
| 48 | 48 | $error = 'Argument of include should be a string, but %s given'; |
| 49 | 49 | throw new InvalidArgumentException(\sprintf($error, $value->getType())); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - yield from $this->loadFile($this->include($ctx, (string)$value->getValue())); |
|
| 52 | + yield from $this->loadFile($this->include($ctx, (string) $value->getValue())); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return $inclusion; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - $pathname = \dirname($file->getPathname()) . \DIRECTORY_SEPARATOR . $inclusion; |
|
| 99 | + $pathname = \dirname($file->getPathname()).\DIRECTORY_SEPARATOR.$inclusion; |
|
| 100 | 100 | $pathname = \str_replace('/./', '/', $pathname); |
| 101 | 101 | |
| 102 | 102 | return $pathname; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** @var DefinitionInterface $definition */ |
| 46 | 46 | $definition = yield $rule->first('> #TypeDefinition'); |
| 47 | 47 | |
| 48 | - yield new NamedDeferred($definition, $ctx, function (ContextInterface $local) use ($definition, $rule) { |
|
| 48 | + yield new NamedDeferred($definition, $ctx, function(ContextInterface $local) use ($definition, $rule) { |
|
| 49 | 49 | $struct = new ObjectDefinitionValueObject(); |
| 50 | 50 | |
| 51 | 51 | $struct->type = Type::object($definition->getName()->getFullyQualifiedName()); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $isConst = $name->getType()->typeOf(Type::const()); |
| 82 | 82 | |
| 83 | - if (! $isConst) { |
|
| 83 | + if (!$isConst) { |
|
| 84 | 84 | $error = 'Generic argument name must be a const but %s given'; |
| 85 | 85 | $exception = new TypeConflictException(\sprintf($error, $name)); |
| 86 | 86 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | throw $exception; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return Name::fromString((string)$name->getValue()); |
|
| 91 | + return Name::fromString((string) $name->getValue()); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $isType = $value->getType()->typeOf(Type::type()); |
| 105 | 105 | |
| 106 | - if (! $isType) { |
|
| 106 | + if (!$isType) { |
|
| 107 | 107 | $error = 'Generic argument value must be a valid type, but %s given'; |
| 108 | 108 | $exception = new TypeConflictException(\sprintf($error, $value)); |
| 109 | 109 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | switch (true) { |
| 130 | 130 | case $isConst: |
| 131 | - return new InvocationPrimitive(Name::fromString((string)$name->getValue())); |
|
| 131 | + return new InvocationPrimitive(Name::fromString((string) $name->getValue())); |
|
| 132 | 132 | |
| 133 | 133 | case $isType: |
| 134 | 134 | /** @var InvocationPrimitive $value */ |
@@ -111,28 +111,28 @@ |
||
| 111 | 111 | |
| 112 | 112 | case \is_object($value): |
| 113 | 113 | if (\method_exists($value, '__toString')) { |
| 114 | - return 'o:' . $value; |
|
| 114 | + return 'o:'.$value; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return 'h:' . \spl_object_hash($value); |
|
| 117 | + return 'h:'.\spl_object_hash($value); |
|
| 118 | 118 | |
| 119 | 119 | case \is_numeric($value): |
| 120 | - return 'n:' . (int)$value; |
|
| 120 | + return 'n:'.(int) $value; |
|
| 121 | 121 | |
| 122 | 122 | case \is_bool($value): |
| 123 | - return 'b:' . (int)$value; |
|
| 123 | + return 'b:'.(int) $value; |
|
| 124 | 124 | |
| 125 | 125 | case \is_string($value): |
| 126 | - return 's:' . $value; |
|
| 126 | + return 's:'.$value; |
|
| 127 | 127 | |
| 128 | 128 | case \is_resource($value): |
| 129 | - return 'r:' . $value; |
|
| 129 | + return 'r:'.$value; |
|
| 130 | 130 | |
| 131 | 131 | case \is_array($value): |
| 132 | - return 'a:' . \md5(\serialize($value)); |
|
| 132 | + return 'a:'.\md5(\serialize($value)); |
|
| 133 | 133 | |
| 134 | 134 | default: |
| 135 | - return 'v:' . \gettype($value) . ':' . \serialize($value); |
|
| 135 | + return 'v:'.\gettype($value).':'.\serialize($value); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -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('BaseParser') |
| 45 | 45 | ->setNamespace('Railt\\SDL\\Frontend') |
| 46 | - ->saveTo(__DIR__ . '/../Frontend'); |
|
| 46 | + ->saveTo(__DIR__.'/../Frontend'); |
|
| 47 | 47 | |
| 48 | 48 | $this->info('OK'); |
| 49 | 49 | } |