| 1 | <?php |
||
| 12 | abstract class BaseUser extends BaseController |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var UserService |
||
| 16 | */ |
||
| 17 | protected $userService; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param Container $container |
||
| 21 | */ |
||
| 22 | public function __construct(Container $container) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return UserService |
||
| 30 | */ |
||
| 31 | protected function getUserService() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | protected function getInput() |
||
| 43 | |||
| 44 | protected function getRedisClient() |
||
| 48 | |||
| 49 | protected function saveInCache($id, $result) |
||
| 55 | |||
| 56 | protected function deleteFromCache($id) |
||
| 62 | |||
| 63 | protected function getFromCache($id) |
||
| 71 | } |
||
| 72 |
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: