1 | <?php |
||
26 | class Bot |
||
27 | { |
||
28 | /** |
||
29 | * @var ProvidersContainerInterface |
||
30 | */ |
||
31 | private $providersContainer; |
||
32 | |||
33 | public function __construct(ProvidersContainerInterface $providersContainer) |
||
40 | |||
41 | /** |
||
42 | * Login and parsing csrfToken from cookies if success |
||
43 | * @param string $username |
||
44 | * @param string $password |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function login($username, $password) |
||
54 | |||
55 | /** |
||
56 | * @param string $provider |
||
57 | * @return Provider |
||
58 | */ |
||
59 | public function __get($provider) |
||
65 | |||
66 | /** |
||
67 | * Validated password and login |
||
68 | * @param string $username |
||
69 | * @param string $password |
||
70 | */ |
||
71 | protected function _checkCredentials($username, $password) |
||
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getLastError() |
||
85 | } |
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: