Passed
Push — master ( b16987...8b6d77 )
by Maurício
03:49 queued 13s
created

UnionKeywords   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 25
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parse() 0 3 1
A buildAll() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\SqlParser\Parsers;
6
7
use PhpMyAdmin\SqlParser\Parseable;
8
use PhpMyAdmin\SqlParser\Parser;
9
use PhpMyAdmin\SqlParser\TokensList;
10
use PhpMyAdmin\SqlParser\Translator;
11
use RuntimeException;
12
use Stringable;
13
14
use function implode;
15
16
/**
17
 * `UNION` keyword builder.
18
 */
19
final class UnionKeywords implements Parseable
20
{
21
    /**
22
     * Parses the tokens contained in the given list in the context of the given parser.
23
     *
24
     * @param Parser               $parser  the parser that serves as context
25
     * @param TokensList           $list    the list of tokens that are being parsed
26
     * @param array<string, mixed> $options parameters for parsing
27
     *
28
     * @throws RuntimeException not implemented yet.
29
     */
30
    public static function parse(Parser $parser, TokensList $list, array $options = []): never
31
    {
32
        throw new RuntimeException(Translator::gettext('Not implemented yet.'));
33
    }
34
35
    /** @param list<array{string|Stringable,string|Stringable}> $component the component to be built */
0 ignored issues
show
Bug introduced by
The type PhpMyAdmin\SqlParser\Parsers\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
36 8
    public static function buildAll(array $component): string
37
    {
38 8
        $tmp = [];
39 8
        foreach ($component as $componentPart) {
40 8
            $tmp[] = $componentPart[0] . ' ' . $componentPart[1];
41
        }
42
43 8
        return implode(' ', $tmp);
44
    }
45
}
46