Completed
Push — master ( ee9170...1dcd4f )
by Kirill
03:45
created
src/Compiler/Definition/DirectiveDelegate.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
     /**
57 57
      * @param DirectiveDefinition $definition
58
-     * @return iterable|DirectiveLocation[]
58
+     * @return \Generator
59 59
      */
60 60
     private function getLocations(DirectiveDefinition $definition): iterable
61 61
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     private function bootLocations(DirectiveDefinition $directive): void
46 46
     {
47 47
         foreach ($this->getLocations($directive) as $offset => $location) {
48
-            $this->transaction($location, function (DirectiveLocation $location) use ($directive): void {
48
+            $this->transaction($location, function(DirectiveLocation $location) use ($directive): void {
49 49
                 $this->verifyLocation($location);
50 50
                 $this->verifyDuplication($directive, $location);
51 51
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $isValid = $location->isExecutable() || $location->isPrivate();
91 91
 
92
-        if (! $isValid) {
92
+        if (!$isValid) {
93 93
             $error = \sprintf('Invalid directive location %s', $location);
94 94
 
95 95
             throw $this->error(new TypeConflictException($error))->in($location);
Please login to merge, or discard this patch.
src/Compiler/Definition/EnumDelegate.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
     /**
58 58
      * @param EnumDefinition $enum
59
-     * @return iterable
59
+     * @return \Generator
60 60
      */
61 61
     private function getEnumValues(EnumDefinition $enum): iterable
62 62
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     private function bootValues(EnumDefinition $enum): void
55 55
     {
56 56
         foreach ($this->getEnumValues($enum) as $value) {
57
-            $this->transaction($value, function (EnumValueDefinition $value) use ($enum): void {
57
+            $this->transaction($value, function(EnumValueDefinition $value) use ($enum): void {
58 58
                 $this->verifyDuplication($enum, $value);
59 59
 
60 60
                 $enum->withValue($value);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         foreach ($this->first('EnumValues', 1) as $ast) {
73 73
             $enumValue = $this->createEnumValue($enum, $ast->first('T_NAME', 1));
74 74
 
75
-            $this->transaction($enumValue, function (EnumValueDefinition $def) use ($ast): void {
75
+            $this->transaction($enumValue, function(EnumValueDefinition $def) use ($ast): void {
76 76
                 //$this->withDescription($def, $ast);
77 77
 
78 78
                 /** @var RuleInterface $defValue */
Please login to merge, or discard this patch.
src/Compiler/Value/StringValue.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     /**
40 40
      * @param NodeInterface|RuleInterface $rule
41
-     * @return mixed|string
41
+     * @return string
42 42
      */
43 43
     protected function parse(NodeInterface $rule): string
44 44
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     private function renderSpecialCharacters(string $body): string
97 97
     {
98
-        $callee = function (array $matches): string {
98
+        $callee = function(array $matches): string {
99 99
             [$char, $code] = [$matches[0], $matches[1]];
100 100
 
101 101
             switch ($code) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     private function renderUtfSequences(string $body): string
129 129
     {
130
-        $callee = function (array $matches): string {
130
+        $callee = function(array $matches): string {
131 131
             [$char, $code] = [$matches[0], $matches[1]];
132 132
 
133 133
             try {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         try {
159 159
             if (\function_exists('\\json_decode')) {
160
-                $result = @\json_decode('{"char": "' . $body . '"}')->char;
160
+                $result = @\json_decode('{"char": "'.$body.'"}')->char;
161 161
 
162 162
                 if (\json_last_error() === \JSON_ERROR_NONE) {
163 163
                     $body = $result;
Please login to merge, or discard this patch.
src/Compiler/Value/ConstantValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected static function getAstName(): string
34 34
     {
35
-        throw new \LogicException(__METHOD__ . ' is non-allowed');
35
+        throw new \LogicException(__METHOD__.' is non-allowed');
36 36
     }
37 37
 
38 38
     /**
@@ -41,6 +41,6 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function parse(NodeInterface $rule): string
43 43
     {
44
-        return (string)$rule->getValue();
44
+        return (string) $rule->getValue();
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
src/Compiler/Value/NumberValue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 return $this->parseInt($value->getValue());
53 53
         }
54 54
 
55
-        return (float)$value->getValue();
55
+        return (float) $value->getValue();
56 56
     }
57 57
 
58 58
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     private function parseExponential(string $value): float
81 81
     {
82
-        return (float)$value;
82
+        return (float) $value;
83 83
     }
84 84
 
85 85
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     private function parseFloat(string $value): float
90 90
     {
91
-        return (float)$value;
91
+        return (float) $value;
92 92
     }
93 93
 
94 94
     /**
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 use Railt\Reflection\Contracts\Document;
12 12
 use Railt\SDL\Compiler;
13 13
 
14
-if (! \function_exists('\\sdl')) {
14
+if (!\function_exists('\\sdl')) {
15 15
     /**
16 16
      * @param string $fileOrSources
17 17
      * @param bool $filename
Please login to merge, or discard this patch.
src/Exception/CompilerException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function __toString(): string
69 69
     {
70
-        $result  = $this->getHeader() . \PHP_EOL;
71
-        $result .= 'Stack trace:' . \PHP_EOL;
70
+        $result  = $this->getHeader().\PHP_EOL;
71
+        $result .= 'Stack trace:'.\PHP_EOL;
72 72
         $result .= $this->getFullTraceAsString();
73 73
 
74 74
         return $result;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         if ($this->stack) {
85 85
             foreach ($this->stack as $def) {
86
-                $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def) . \PHP_EOL;
86
+                $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def).\PHP_EOL;
87 87
             }
88 88
         }
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 continue;
93 93
             }
94 94
 
95
-            $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line) . "\n";
95
+            $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line)."\n";
96 96
         }
97 97
 
98 98
         return $result;
Please login to merge, or discard this patch.
src/Console/SDLAnalyzeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@
 block discarded – undo
37 37
         $ast = (new Parser())->parse(File::fromPathname($this->argument('schema')));
38 38
 
39 39
         if ($root = $this->option('find')) {
40
-            foreach ($ast->find((string)$root) as $child) {
41
-                $this->writeln((string)$child);
40
+            foreach ($ast->find((string) $root) as $child) {
41
+                $this->writeln((string) $child);
42 42
             }
43 43
         } else {
44
-            $this->writeln((string)$ast);
44
+            $this->writeln((string) $ast);
45 45
         }
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
src/Console/SDLCompileCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @var string
23 23
      */
24
-    private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/grammar.pp2';
24
+    private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/grammar.pp2';
25 25
 
26 26
     /**
27 27
      * @var string
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         Compiler::load(File::fromPathname(self::SCHEMA_SDL_GRAMMAR))
44 44
             ->setClassName('Parser')
45 45
             ->setNamespace('Railt\\SDL')
46
-            ->saveTo(__DIR__ . '/../');
46
+            ->saveTo(__DIR__.'/../');
47 47
 
48 48
         $this->info('OK');
49 49
     }
Please login to merge, or discard this patch.