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