1 | <?php |
||
5 | trait InteractsWithAuthentication |
||
6 | { |
||
7 | /** {@inheritdoc} */ |
||
8 | public function login() |
||
16 | |||
17 | /** {@inheritdoc} */ |
||
18 | public function loginAs($userId, $guard = null) |
||
26 | |||
27 | /** {@inheritdoc} */ |
||
28 | public function logout($guard = null) |
||
36 | |||
37 | /** {@inheritdoc} */ |
||
38 | public function assertAuthenticated($guard = null) |
||
44 | |||
45 | /** {@inheritdoc} */ |
||
46 | public function assertGuest($guard = null) |
||
52 | |||
53 | /** {@inheritdoc} */ |
||
54 | public function assertAuthenticatedAs($user, $guard = null) |
||
60 | } |
||
61 |
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: