| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function endpoints($controller = null, $parameters = null): LinkResource |
||
| 17 | { |
||
| 18 | $resource = LinkResource::create($this->resource, LinkResourceType::ITEM)->endpoint($controller, $parameters); |
||
|
|
|||
| 19 | |||
| 20 | if (property_exists($this, 'mergeCollectionEndpoints') && $this->mergeCollectionEndpoints === true) { |
||
| 21 | $resource->mergeCollectionEndpoints(); |
||
| 22 | } |
||
| 23 | |||
| 24 | return $resource; |
||
| 25 | } |
||
| 26 | |||
| 38 |
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: