Total Complexity | 7 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 76.47% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | final class WithKeyword implements Component |
||
17 | { |
||
18 | /** @var string */ |
||
19 | public $name; |
||
20 | |||
21 | /** @var ArrayObj[] */ |
||
22 | public $columns = []; |
||
23 | |||
24 | /** @var Parser|null */ |
||
25 | public $statement; |
||
26 | |||
27 | 48 | public function __construct(string $name) |
|
28 | { |
||
29 | 48 | $this->name = $name; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * Parses the tokens contained in the given list in the context of the given parser. |
||
34 | * |
||
35 | * @param Parser $parser the parser that serves as context |
||
36 | * @param TokensList $list the list of tokens that are being parsed |
||
37 | * @param array<string, mixed> $options parameters for parsing |
||
38 | * |
||
39 | * @return mixed |
||
40 | * |
||
41 | * @throws RuntimeException not implemented yet. |
||
42 | */ |
||
43 | public static function parse(Parser $parser, TokensList $list, array $options = []) |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param WithKeyword $component |
||
50 | */ |
||
51 | 12 | public static function build($component): string |
|
72 | } |
||
73 | |||
74 | public function __toString(): string |
||
79 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.