1 | <?php |
||
26 | class Bot |
||
27 | { |
||
28 | protected $username; |
||
29 | protected $password; |
||
30 | |||
31 | /** |
||
32 | * @var ProvidersContainerInterface |
||
33 | */ |
||
34 | private $providersContainer; |
||
35 | |||
36 | public function __construct(ProvidersContainerInterface $providersContainer) |
||
43 | |||
44 | /** |
||
45 | * Login and parsing csrfToken from cookies if success |
||
46 | * @param $username |
||
47 | * @param $password |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function login($username, $password) |
||
60 | |||
61 | /** |
||
62 | * @param string $provider |
||
63 | * @return Provider |
||
64 | */ |
||
65 | public function __get($provider) |
||
71 | |||
72 | /** |
||
73 | * @throws LogicException |
||
74 | */ |
||
75 | protected function _checkCredentials() |
||
81 | |||
82 | /** |
||
83 | * @return array |
||
84 | */ |
||
85 | public function getLastError() |
||
89 | } |
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: