Completed
Push — master ( fe9d21...06b28a )
by Kirill
04:29
created
src/Compiler/Value/StringValue.php 1 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/Compiler/Definition/DefinitionDelegate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
         $this->definition = $this->bootDefinition($this->document);
62 62
 
63
-        $this->stack->transaction($this->definition, function (AbstractDefinition $record): void {
63
+        $this->stack->transaction($this->definition, function(AbstractDefinition $record): void {
64 64
             $record->withOffset($this->getOffset());
65 65
 
66 66
             if ($record instanceof TypeDefinition) {
Please login to merge, or discard this patch.
src/Compiler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function autoload(\Closure $then): void
86 86
     {
87
-        $this->dictionary->onTypeNotFound(function (string $type, ?Definition $from) use ($then): void {
87
+        $this->dictionary->onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void {
88 88
             if (($file = $then($type, $from)) instanceof Readable) {
89 89
                 $this->compile($file);
90 90
             }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $key = $document->getFile()->getHash();
118 118
 
119
-        if (! isset($this->documents[$key])) {
119
+        if (!isset($this->documents[$key])) {
120 120
             $otherwise && $otherwise($document);
121 121
         }
122 122
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function compile(Readable $file): DocumentInterface
131 131
     {
132
-        return $this->memomize(new Document($this->reflection, $file), function (Document $document) use ($file): void {
132
+        return $this->memomize(new Document($this->reflection, $file), function(Document $document) use ($file): void {
133 133
             $ast = $this->parse($document, $file);
134 134
 
135 135
             foreach ($ast as $type) {
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.