Completed
Push — master ( 578d3a...04a929 )
by Maurício
34s queued 14s
created

UnionKeywords::buildAll()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 8
rs 10
ccs 5
cts 5
cp 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\SqlParser\Components\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\Components\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