@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * @param ContextInterface $ctx |
| 40 | 40 | * @param RuleInterface $rule |
| 41 | - * @return \Generator|Definition |
|
| 41 | + * @return \Generator |
|
| 42 | 42 | * @throws InvalidArgumentException |
| 43 | 43 | */ |
| 44 | 44 | public function reduce(ContextInterface $ctx, RuleInterface $rule): \Generator |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * @param RuleInterface $argument |
| 63 | - * @return \Generator|TypeNameInterface |
|
| 63 | + * @return \Generator |
|
| 64 | 64 | */ |
| 65 | 65 | private function getArgumentName(RuleInterface $argument): \Generator |
| 66 | 66 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * @param RuleInterface $argument |
| 73 | - * @return \Generator|TypeNameInterface |
|
| 73 | + * @return \Generator |
|
| 74 | 74 | */ |
| 75 | 75 | private function getArgumentValue(RuleInterface $argument): \Generator |
| 76 | 76 | { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | yield from $name = $this->getArgumentName($argument); |
| 48 | 48 | yield from $value = $this->getArgumentValue($argument); |
| 49 | 49 | |
| 50 | - $definition->addArgument((string)$name->getReturn(), $value->getReturn()); |
|
| 50 | + $definition->addArgument((string) $name->getReturn(), $value->getReturn()); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return $definition; |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | /** |
| 38 | 38 | * @param ContextInterface $ctx |
| 39 | 39 | * @param RuleInterface $rule |
| 40 | - * @return \Generator|mixed |
|
| 40 | + * @return \Generator |
|
| 41 | 41 | */ |
| 42 | 42 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
| 43 | 43 | { |
@@ -15,9 +15,7 @@ |
||
| 15 | 15 | use Railt\SDL\Frontend\Deferred\Deferred; |
| 16 | 16 | use Railt\SDL\Frontend\Deferred\DeferredInterface; |
| 17 | 17 | use Railt\SDL\Frontend\Deferred\NamedDeferred; |
| 18 | -use Railt\SDL\IR\SymbolTable\Value; |
|
| 19 | 18 | use Railt\SDL\IR\SymbolTable\VarSymbolInterface; |
| 20 | -use Railt\SDL\IR\Type; |
|
| 21 | 19 | use Railt\SDL\IR\Type\TypeNameInterface; |
| 22 | 20 | |
| 23 | 21 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $name = yield $rule->first('> #TypeName'); |
| 46 | 46 | |
| 47 | 47 | yield $this->deferred($ctx, yield $rule->first('> #TypeName')) |
| 48 | - ->then(function (ContextInterface $context) use ($name, $rule) { |
|
| 48 | + ->then(function(ContextInterface $context) use ($name, $rule) { |
|
| 49 | 49 | return $this->then($context, $rule, $name); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * @param ContextInterface $ctx |
| 33 | 33 | * @param RuleInterface $rule |
| 34 | - * @return \Generator|\Closure |
|
| 34 | + * @return \Generator |
|
| 35 | 35 | */ |
| 36 | 36 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
| 37 | 37 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
| 37 | 37 | { |
| 38 | - yield function () use ($ctx, $rule): \Generator { |
|
| 38 | + yield function() use ($ctx, $rule): \Generator { |
|
| 39 | 39 | /** @var ValueInterface $value */ |
| 40 | 40 | $value = yield $rule->first('> #VariableValue')->getChild(0); |
| 41 | 41 | |
@@ -58,6 +58,6 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function __toString(): string |
| 60 | 60 | { |
| 61 | - return $this->getName() . ': ' . $this->getHint()->getFullyQualifiedName(); |
|
| 61 | + return $this->getName().': '.$this->getHint()->getFullyQualifiedName(); |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -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 | |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function match(string $lexeme, string $value): bool |
| 32 | 32 | { |
| 33 | - return (bool)\preg_match(self::pattern($lexeme), $value); |
|
| 33 | + return (bool) \preg_match(self::pattern($lexeme), $value); |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -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 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function throwsIn(Readable $file, int $offsetOrLine = 0, int $column = null): ExternalExceptionInterface |
| 57 | 57 | { |
| 58 | - if (! $this->defined) { |
|
| 58 | + if (!$this->defined) { |
|
| 59 | 59 | $this->defined = true; |
| 60 | 60 | |
| 61 | 61 | return parent::throwsIn($file, $offsetOrLine, $column); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var string |
| 34 | 34 | */ |
| 35 | - public const INTERFACE = 'Interface'; |
|
| 35 | + public const interface = 'Interface'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @var string |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * @var string |
| 89 | 89 | */ |
| 90 | - public const LIST = 'List'; |
|
| 90 | + public const list = 'List'; |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * @var string |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * @var string |
| 134 | 134 | */ |
| 135 | - public const NULL = 'Null'; |
|
| 135 | + public const null = 'Null'; |
|
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | 138 | * @var string |
| 139 | 139 | */ |
| 140 | - public const CONST = 'Const'; |
|
| 140 | + public const const = 'Const'; |
|
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | 143 | * @var string |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | self::SCALAR, |
| 152 | 152 | self::OBJECT, |
| 153 | 153 | self::DIRECTIVE, |
| 154 | - self::INTERFACE, |
|
| 154 | + self::interface, |
|
| 155 | 155 | self::UNION, |
| 156 | 156 | self::ENUM, |
| 157 | 157 | self::INPUT_OBJECT, |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public const WRAPPING_TYPES = [ |
| 177 | 177 | self::NON_NULL, |
| 178 | - self::LIST, |
|
| 178 | + self::list, |
|
| 179 | 179 | ]; |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | self::INPUT_OBJECT, |
| 189 | 189 | self::INPUT_FIELD, |
| 190 | 190 | self::NON_NULL, |
| 191 | - self::LIST, |
|
| 191 | + self::list, |
|
| 192 | 192 | self::ANY, |
| 193 | 193 | ]; |
| 194 | 194 | |
@@ -198,11 +198,11 @@ discard block |
||
| 198 | 198 | public const ALLOWS_TO_OUTPUT = [ |
| 199 | 199 | self::SCALAR, |
| 200 | 200 | self::OBJECT, |
| 201 | - self::INTERFACE, |
|
| 201 | + self::interface, |
|
| 202 | 202 | self::UNION, |
| 203 | 203 | self::ENUM, |
| 204 | 204 | self::NON_NULL, |
| 205 | - self::LIST, |
|
| 205 | + self::list, |
|
| 206 | 206 | self::ANY, |
| 207 | 207 | ]; |
| 208 | 208 | |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | self::FLOAT, |
| 217 | 217 | self::ID, |
| 218 | 218 | self::DATE_TIME, |
| 219 | - self::NULL, |
|
| 220 | - self::CONST, |
|
| 219 | + self::null, |
|
| 220 | + self::const, |
|
| 221 | 221 | ]; |
| 222 | 222 | |
| 223 | 223 | /** |