| Total Complexity | 3 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Config implements AdapterInterface |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * container |
||
| 19 | * |
||
| 20 | * @var Container |
||
| 21 | */ |
||
| 22 | protected $container; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * user model |
||
| 26 | * |
||
| 27 | * @var Users |
||
| 28 | */ |
||
| 29 | protected $modelUsers; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * instanciate |
||
| 33 | * |
||
| 34 | * @param Container $container |
||
| 35 | */ |
||
| 36 | 4 | public function __construct(Container $container) |
|
| 37 | { |
||
| 38 | 4 | $this->container = $container; |
|
| 39 | 4 | $this->modelUsers = new Users( |
|
| 40 | 4 | $this->container->getService(AppConfig::class) |
|
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * auth process |
||
| 46 | * |
||
| 47 | * @param string $login |
||
| 48 | * @param string $password |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | 2 | public function auth(string $login, string $password): array |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * get user by id |
||
| 58 | * |
||
| 59 | * @param integer $id |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | 1 | public function getById(int $id): array |
|
| 65 | } |
||
| 66 | } |
||
| 67 |