@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Railt\Io\Readable; |
| 15 | 15 | use Railt\Reflection\Contracts\Reflection; |
| 16 | 16 | use Railt\Reflection\Document; |
| 17 | -use Railt\SDL\Frontend\Context\LocalContext; |
|
| 18 | 17 | use Railt\SDL\Frontend\Record\RecordInterface; |
| 19 | 18 | |
| 20 | 19 | /** |
@@ -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 | |
@@ -14,14 +14,12 @@ |
||
| 14 | 14 | use Psr\Log\LoggerInterface; |
| 15 | 15 | use Railt\Io\File; |
| 16 | 16 | use Railt\Io\Readable; |
| 17 | -use Railt\Reflection\Contracts\Document as DocumentInterface; |
|
| 18 | 17 | use Railt\Reflection\Contracts\Document; |
| 19 | 18 | use Railt\Reflection\Reflection; |
| 20 | 19 | use Railt\SDL\Compiler\Dictionary; |
| 21 | 20 | use Railt\SDL\Compiler\Store; |
| 22 | 21 | use Railt\SDL\Exception\CompilerException; |
| 23 | 22 | use Railt\SDL\Exception\InternalException; |
| 24 | -use Railt\SDL\Frontend\Context\LocalContext; |
|
| 25 | 23 | use Railt\SDL\Frontend\Record\RecordInterface; |
| 26 | 24 | |
| 27 | 25 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function compile(Readable $file): DocumentInterface |
| 102 | 102 | { |
| 103 | - return $this->store->memoize($file, function (Readable $file): DocumentInterface { |
|
| 103 | + return $this->store->memoize($file, function(Readable $file): DocumentInterface { |
|
| 104 | 104 | return $this->generate($file, $this->ir($file)); |
| 105 | 105 | }); |
| 106 | 106 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function generate(Readable $readable, iterable $records): Document |
| 115 | 115 | { |
| 116 | - return $this->wrap(function () use ($readable, $records) { |
|
| 116 | + return $this->wrap(function() use ($readable, $records) { |
|
| 117 | 117 | return $this->back->run($readable, $records); |
| 118 | 118 | }); |
| 119 | 119 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | private function ir(Readable $readable): iterable |
| 127 | 127 | { |
| 128 | - return $this->wrap(function () use ($readable) { |
|
| 128 | + return $this->wrap(function() use ($readable) { |
|
| 129 | 129 | return $this->front->load($readable); |
| 130 | 130 | }); |
| 131 | 131 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * @param Readable $file |
| 88 | 88 | * @param RuleInterface $ast |
| 89 | - * @return iterable|RecordInterface[] |
|
| 89 | + * @return \Generator |
|
| 90 | 90 | */ |
| 91 | 91 | public function build(Readable $file, RuleInterface $ast): iterable |
| 92 | 92 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | /** |
| 115 | 115 | * @param ContextInterface $context |
| 116 | 116 | * @param RuleInterface $ast |
| 117 | - * @return mixed|\Traversable|void |
|
| 117 | + * @return ContextInterface |
|
| 118 | 118 | * @throws \Railt\Io\Exception\ExternalFileException |
| 119 | 119 | */ |
| 120 | 120 | private function resolve(ContextInterface $context, RuleInterface $ast) |
@@ -16,6 +16,6 @@ |
||
| 16 | 16 | { |
| 17 | 17 | protected function parse() |
| 18 | 18 | { |
| 19 | - throw new \LogicException(__METHOD__ . ' not implemented yet'); |
|
| 19 | + throw new \LogicException(__METHOD__.' not implemented yet'); |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -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 | |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | /** |
| 110 | 110 | * {@inheritDoc} |
| 111 | 111 | */ |
| 112 | - public function instanceOf(TypeInterface $type): bool |
|
| 112 | + public function instanceof(TypeInterface $type): bool |
|
| 113 | 113 | { |
| 114 | 114 | $needle = $type->getName()->getFullyQualifiedName(); |
| 115 | 115 | |
@@ -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 |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @var string[]|array[] |
| 64 | 64 | */ |
| 65 | 65 | public const INHERITANCE_TREE = [ |
| 66 | - self::INTERFACE => [ |
|
| 66 | + self::interface => [ |
|
| 67 | 67 | self::OBJECT => [ |
| 68 | 68 | self::INPUT_OBJECT |
| 69 | 69 | ], |
@@ -103,5 +103,5 @@ discard block |
||
| 103 | 103 | * @param TypeInterface $type |
| 104 | 104 | * @return bool |
| 105 | 105 | */ |
| 106 | - public function instanceOf(TypeInterface $type): bool; |
|
| 106 | + public function instanceof(TypeInterface $type): bool; |
|
| 107 | 107 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function match(RuleInterface $rule): bool |
| 43 | 43 | { |
| 44 | - return (bool)(self::TYPE_DEFINITIONS[$rule->getName()] ?? false); |
|
| 44 | + return (bool) (self::TYPE_DEFINITIONS[$rule->getName()] ?? false); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | return $inclusion; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - $pathname = \dirname($file->getPathname()) . \DIRECTORY_SEPARATOR . $inclusion; |
|
| 97 | + $pathname = \dirname($file->getPathname()).\DIRECTORY_SEPARATOR.$inclusion; |
|
| 98 | 98 | $pathname = \str_replace('/./', '/', $pathname); |
| 99 | 99 | |
| 100 | 100 | return $pathname; |