Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function endpoints(string $controller = null, $parameters = null): EndpointResource |
||
14 | { |
||
15 | $endPointResourceType = $this->mergeGlobalEndpoints |
||
16 | ? EndpointResourceType::MULTI |
||
17 | : EndpointResourceType::LOCAL; |
||
18 | |||
19 | $endPointResource = new EndpointResource($this->resource, $endPointResourceType); |
||
|
|||
20 | |||
21 | if ($controller !== null) { |
||
22 | $endPointResource->addController($controller, Arr::wrap($parameters)); |
||
23 | } |
||
24 | |||
25 | return $endPointResource; |
||
26 | } |
||
27 | |||
63 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: