1 | <?php |
||
19 | abstract class AbstractBasic extends AbstractAdapter |
||
20 | { |
||
21 | /** |
||
22 | * Attributes |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $attributes = []; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Init adapter |
||
31 | * |
||
32 | * @param LoggerInterface $logger |
||
33 | * @param Iterable $config |
||
34 | * @return void |
||
|
|||
35 | */ |
||
36 | public function __construct(LoggerInterface $logger, ?Iterable $config=null) |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Authenticate |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function authenticate(): bool |
||
78 | |||
79 | |||
80 | /** |
||
81 | * Auth |
||
82 | * |
||
83 | * @param string $username |
||
84 | * @param string $password |
||
85 | * @return bool |
||
86 | */ |
||
87 | protected function plainAuth(string $username, string $password): bool |
||
119 | |||
120 | |||
121 | /** |
||
122 | * Find Identity |
||
123 | * |
||
124 | * @param string $username |
||
125 | * @return array |
||
126 | */ |
||
127 | protected abstract function findIdentity(string $username): ?array; |
||
128 | |||
129 | |||
130 | /** |
||
131 | * Get attributes |
||
132 | * |
||
133 | * @return array |
||
134 | */ |
||
135 | public function getAttributes(): array |
||
139 | } |
||
140 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.