Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | final class ConsoleCursorBuilder implements IConsoleCursorBuilder |
||
18 | { |
||
19 | private ?CursorVisibilityMode $cursorVisibilityMode = null; |
||
20 | private ?IBuffer $buffer = null; |
||
21 | |||
22 | public function build(): IConsoleCursor |
||
23 | { |
||
24 | $this->validate(); |
||
25 | |||
26 | return new ConsoleCursor( |
||
27 | $this->buffer, |
||
28 | $this->cursorVisibilityMode, |
||
29 | ); |
||
30 | } |
||
31 | |||
32 | private function validate(): void |
||
33 | { |
||
34 | match (true) { |
||
35 | $this->buffer === null => throw new LogicException('Buffer is not set.'), |
||
36 | $this->cursorVisibilityMode === null => throw new LogicException('CursorVisibilityMode is not set.'), |
||
37 | default => null, |
||
38 | }; |
||
39 | } |
||
40 | |||
41 | public function withBuffer(IBuffer $buffer): IConsoleCursorBuilder |
||
42 | { |
||
43 | $clone = clone $this; |
||
44 | $clone->buffer = $buffer; |
||
45 | return $clone; |
||
46 | } |
||
47 | |||
48 | public function withCursorVisibilityMode(CursorVisibilityMode $cursorVisibilityMode): IConsoleCursorBuilder |
||
53 | } |
||
54 | } |
||
55 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths