Passed
Pull Request — master (#521)
by
unknown
08:41 queued 05:54
created
src/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
      */
66 66
     public static function gettext(string $msgid): string
67 67
     {
68
-        if (! class_exists(Loader::class, true)) {
68
+        if (!class_exists(Loader::class, true)) {
69 69
             return $msgid;
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/Parser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
      * @param string|UtfString|TokensList|null $list   the list of tokens to be parsed
378 378
      * @param bool                             $strict whether strict mode should be enabled or not
379 379
      */
380
-    public function __construct(string|UtfString|TokensList|null $list = null, bool $strict = false)
380
+    public function __construct(string | UtfString | TokensList | null $list = null, bool $strict = false)
381 381
     {
382 382
         if (Context::$keywords === []) {
383 383
             Context::load();
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
                 $list->idx = $lastIdx;
508 508
             } elseif (empty(self::STATEMENT_PARSERS[$token->keyword])) {
509 509
                 // Checking if it is a known statement that can be parsed.
510
-                if (! isset(self::STATEMENT_PARSERS[$token->keyword])) {
510
+                if (!isset(self::STATEMENT_PARSERS[$token->keyword])) {
511 511
                     // A statement is considered recognized if the parser
512 512
                     // is aware that it is a statement, but it does not have
513 513
                     // a parser for it yet.
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 
548 548
             // Handles unions.
549 549
             if (
550
-                ! empty($unionType)
550
+                !empty($unionType)
551 551
                 && ($lastStatement instanceof SelectStatement)
552 552
                 && ($statement instanceof SelectStatement)
553 553
             ) {
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
      *
635 635
      * @throws ParserException throws the exception, if strict mode is enabled.
636 636
      */
637
-    public function error(string $msg, Token|null $token = null, int $code = 0): void
637
+    public function error(string $msg, Token | null $token = null, int $code = 0): void
638 638
     {
639 639
         $error = new ParserException(
640 640
             Translator::gettext($msg),
Please login to merge, or discard this patch.
src/Tools/TestGenerator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         // The code below extracts only the relevant information.
84 84
 
85 85
         // Extracting lexer's errors.
86
-        if (! empty($lexer->errors)) {
86
+        if (!empty($lexer->errors)) {
87 87
             /** @var LexerException $err */
88 88
             foreach ($lexer->errors as $err) {
89 89
                 $lexerErrors[] = [
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         }
99 99
 
100 100
         // Extracting parser's errors.
101
-        if (! empty($parser->errors)) {
101
+        if (!empty($parser->errors)) {
102 102
             /** @var ParserException $err */
103 103
             foreach ($parser->errors as $err) {
104 104
                 $parserErrors[] = [
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
         string $type,
138 138
         string $input,
139 139
         string $output,
140
-        string|null $debug = null,
140
+        string | null $debug = null,
141 141
         bool $ansi = false
142 142
     ): void {
143 143
         // Support query types: `lexer` / `parser`.
144
-        if (! in_array($type, ['lexer', 'parser'])) {
144
+        if (!in_array($type, ['lexer', 'parser'])) {
145 145
             throw new Exception('Unknown test type (expected `lexer` or `parser`).');
146 146
         }
147 147
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         );
187 187
 
188 188
         // Remove the project path from .out file, it changes for each dev
189
-        $projectFolder = dirname(__DIR__, 2);// Jump to root
189
+        $projectFolder = dirname(__DIR__, 2); // Jump to root
190 190
         $encoded = str_replace($projectFolder, '<project-root>', $encoded);
191 191
 
192 192
         file_put_contents($output, $encoded);
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
             if (is_dir($inputFile)) {
224 224
                 // Creating required directories to maintain the structure.
225 225
                 // Ignoring errors if the folder structure exists already.
226
-                if (! is_dir($outputFile)) {
226
+                if (!is_dir($outputFile)) {
227 227
                     mkdir($outputFile);
228 228
                 }
229 229
 
230
-                if (($debug !== null) && (! is_dir($debugFile))) {
230
+                if (($debug !== null) && (!is_dir($debugFile))) {
231 231
                     mkdir($debugFile);
232 232
                 }
233 233
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 }
243 243
 
244 244
                 // Building the test.
245
-                if (! file_exists($outputFile)) {
245
+                if (!file_exists($outputFile)) {
246 246
                     echo sprintf("Building test for %s...\n", $inputFile);
247 247
                     static::build(
248 248
                         str_contains($inputFile, 'lex') ? 'lexer' : 'parser',
Please login to merge, or discard this patch.