| 1 | <?php |
||
| 10 | abstract class ServiceAbstract implements ServiceInterface |
||
| 11 | { |
||
| 12 | 51 | public function setResponse(ResponseInterface $response) |
|
| 20 | |||
| 21 | 12 | public function getResponse(): \StdClass |
|
| 25 | |||
| 26 | 39 | public function getResponseAttribute(string $attribute) |
|
| 34 | |||
| 35 | 6 | public function toArray(): array |
|
| 39 | } |
||
| 40 |
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: