Completed
Push — master ( 9a6f5b...ef0055 )
by Pierre
02:26
created

Auth   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A auth() 0 3 1
1
<?php
2
3
namespace App\Component;
4
5
use App\Container;
6
use App\Model\Users;
7
8
class Auth
9
{
10
11
    protected $userModel;
12
13
    /**
14
     * instanciate
15
     */
16 2
    public function __construct(Container $container)
17
    {
18 2
        $this->userModel = new Users(
19 2
            $container->getService(\App\Config::class)
20
        );
21
    }
22
23
    /**
24
     * auth from login password and return user as array
25
     *
26
     * @param string $login
27
     * @param string $password
28
     * @return array
29
     */
30 1
    public function auth(string $login, string $password): array
31
    {
32 1
        return $this->userModel->auth($login, $password);
33
    }
34
}
35