1 | <?php |
||
30 | class UserScopeService { |
||
31 | |||
32 | public function __construct(IUserSession $userSession, IUserManager $userManager) { |
||
36 | |||
37 | /** |
||
38 | * Set a valid user in IUserSession since lots of server logic is relying on obtaining |
||
39 | * the current acting user from that |
||
40 | * |
||
41 | * @param $uid |
||
42 | * @throws \InvalidArgumentException |
||
43 | */ |
||
44 | public function setUserScope(string $uid) { |
||
51 | } |
||
52 |
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: