Completed
Push — master ( 8afd90...4bf010 )
by Kirill
03:48
created
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/Compiler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
      */
83 83
     public function autoload(\Closure $then): void
84 84
     {
85
-        $this->dictionary->onTypeNotFound(function (string $type, ?Definition $from) use ($then): void {
85
+        $this->dictionary->onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void {
86 86
             if (($file = $then($type, $from)) instanceof Readable) {
87 87
                 $this->compile($file);
88 88
             }
Please login to merge, or discard this patch.
src/Compiler/Pipeline.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function push(int $priority, callable $then): void
76 76
     {
77
-        if (! \array_key_exists($priority, $this->queue)) {
77
+        if (!\array_key_exists($priority, $this->queue)) {
78 78
             $this->queue[$priority] = $this->createList();
79 79
         }
80 80
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function count(): int
96 96
     {
97
-        return (int)\array_reduce($this->queue, function (int $result, \SplQueue $queue): int {
97
+        return (int) \array_reduce($this->queue, function(int $result, \SplQueue $queue): int {
98 98
             return $result + $queue->count();
99 99
         }, 0);
100 100
     }
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\\Compiler')
46
-            ->saveTo(__DIR__ . '/../Compiler');
46
+            ->saveTo(__DIR__.'/../Compiler');
47 47
 
48 48
         $this->info('OK');
49 49
     }
Please login to merge, or discard this patch.
src/Compiler/Ast/Value/StringValueNode.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     private function renderUtfSequences(string $body): string
95 95
     {
96
-        $callee = function (array $matches): string {
96
+        $callee = function(array $matches): string {
97 97
             [$char, $code] = [$matches[0], $matches[1]];
98 98
 
99 99
             try {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         try {
125 125
             if (\function_exists('\\json_decode')) {
126
-                $result = @\json_decode('{"char": "' . $body . '"}')->char;
126
+                $result = @\json_decode('{"char": "'.$body.'"}')->char;
127 127
 
128 128
                 if (\json_last_error() === \JSON_ERROR_NONE) {
129 129
                     $body = $result;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     private function renderSpecialCharacters(string $body): string
145 145
     {
146
-        $callee = function (array $matches): string {
146
+        $callee = function(array $matches): string {
147 147
             [$char, $code] = [$matches[0], $matches[1]];
148 148
 
149 149
             switch ($code) {
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 declare(strict_types=1);
9 9
 
10
-if (! \function_exists('\\sdl')) {
10
+if (!\function_exists('\\sdl')) {
11 11
     /**
12 12
      * @param string $fileOrSources
13 13
      * @param bool $filename
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 }
26 26
 
27 27
 
28
-if (! \function_exists('trait_uses_recursive')) {
28
+if (!\function_exists('trait_uses_recursive')) {
29 29
     /**
30 30
      * Returns all traits used by a trait and its traits.
31 31
      *
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 
48
-if (! \function_exists('class_uses_recursive')) {
48
+if (!\function_exists('class_uses_recursive')) {
49 49
     /**
50 50
      * Returns all traits used by a class, its parent classes and trait of their traits.
51 51
      *
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 }
70 70
 
71 71
 
72
-if (! \function_exists('class_basename')) {
72
+if (!\function_exists('class_basename')) {
73 73
     /**
74 74
      * Get the class "basename" of the given object / class.
75 75
      *
Please login to merge, or discard this patch.
src/Compiler/Builder/Invocation/DirectiveBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             /** @var DirectiveDefinition $definition */
38 38
             $definition = $directive->getDefinition();
39 39
 
40
-            if (! ($definition instanceof Definition\DirectiveDefinition)) {
40
+            if (!($definition instanceof Definition\DirectiveDefinition)) {
41 41
                 $error = '%s should be a Directive, but %s given';
42 42
                 throw (new TypeConflictException(\sprintf($error, $directive, $definition)))
43 43
                     ->throwsIn($directive->getFile(), $rule->getOffset());
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             foreach ($rule->getDirectiveArguments() as $ast) {
48 48
                 $name = $ast->getArgumentName();
49 49
 
50
-                if (! $definition->hasArgument($name)) {
50
+                if (!$definition->hasArgument($name)) {
51 51
                     $error = 'Directive %s does not provide argument %s';
52 52
                     throw (new TypeConflictException(\sprintf($error, $definition, $name)))
53 53
                         ->throwsIn($directive->getFile(), $ast->getOffset());
Please login to merge, or discard this patch.
src/Compiler/Builder/Definition/ScalarBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         $scalar->withOffset($rule->getOffset());
33 33
         $scalar->withDescription($rule->getDescription());
34 34
 
35
-        $this->when->resolving(function () use ($rule, $scalar) {
35
+        $this->when->resolving(function() use ($rule, $scalar) {
36 36
             if ($ast = $rule->getExtends()) {
37 37
                 $parent = $this->load($ast->getTypeName(), $scalar);
38 38
 
39
-                if (! ($parent instanceof Definition\ScalarDefinition)) {
39
+                if (!($parent instanceof Definition\ScalarDefinition)) {
40 40
                     $error = '%s can extends only Scalar type, but %s given';
41 41
                     throw (new TypeConflictException(\sprintf($error, $scalar, $parent)))
42 42
                         ->throwsIn($scalar->getFile(), $rule->getOffset());
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             }
47 47
         });
48 48
 
49
-        $this->when->runtime(function () use ($rule, $scalar) {
49
+        $this->when->runtime(function() use ($rule, $scalar) {
50 50
             foreach ($rule->getDirectives() as $ast) {
51 51
                 $scalar->withDirective($this->dependent($ast, $scalar));
52 52
             }
Please login to merge, or discard this patch.
src/Compiler/Builder/Definition/InterfaceBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@
 block discarded – undo
37 37
             $interface->withField($this->dependent($ast, $interface));
38 38
         }
39 39
 
40
-        $this->when->runtime(function () use ($rule, $interface) {
40
+        $this->when->runtime(function() use ($rule, $interface) {
41 41
             foreach ($rule->getDirectives() as $ast) {
42 42
                 $interface->withDirective($this->dependent($ast, $interface));
43 43
             }
44 44
         });
45 45
 
46
-        $this->when->resolving(function () use ($rule, $interface) {
46
+        $this->when->resolving(function() use ($rule, $interface) {
47 47
             foreach ($rule->getImplementations() as $child) {
48 48
                 $interface->withInterface($child->getTypeName());
49 49
             }
Please login to merge, or discard this patch.