1 | <?php |
||
11 | trait OAuthBehavior |
||
12 | { |
||
13 | /** |
||
14 | * @var User |
||
15 | */ |
||
16 | protected $user; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $token; |
||
22 | |||
23 | /** |
||
24 | * EnhancedProvider constructor. |
||
25 | * |
||
26 | * @param array $config |
||
27 | */ |
||
28 | public function __construct(array $config) |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | protected function callbackUrl($config, $request) |
||
48 | |||
49 | /** |
||
50 | * @return Store |
||
51 | */ |
||
52 | public function session() |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | protected function getState() |
||
67 | |||
68 | /** |
||
69 | * @return User |
||
70 | */ |
||
71 | public function user() |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function name() |
||
87 | } |
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: