Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | final class FunctionCall implements Component |
||
15 | { |
||
16 | /** |
||
17 | * The name of this function. |
||
18 | * |
||
19 | * @var string|null |
||
20 | */ |
||
21 | public $name; |
||
22 | |||
23 | /** |
||
24 | * The list of parameters. |
||
25 | * |
||
26 | * @var ArrayObj|null |
||
27 | */ |
||
28 | public $parameters; |
||
29 | |||
30 | /** |
||
31 | * @param string|null $name the name of the function to be called |
||
32 | * @param string[]|ArrayObj|null $parameters the parameters of this function |
||
33 | */ |
||
34 | 34 | public function __construct(string|null $name = null, array|ArrayObj|null $parameters = null) |
|
35 | { |
||
36 | 34 | $this->name = $name; |
|
37 | 34 | if (is_array($parameters)) { |
|
38 | 2 | $this->parameters = new ArrayObj($parameters); |
|
39 | 32 | } elseif ($parameters instanceof ArrayObj) { |
|
40 | 2 | $this->parameters = $parameters; |
|
41 | } |
||
42 | } |
||
43 | |||
44 | 4 | public function build(): string |
|
47 | } |
||
48 | |||
49 | public function __toString(): string |
||
54 |