Test Setup Failed
Push — master ( e205b4...c4acc3 )
by Php Easy Api
03:40
created

AuthenticateRequest::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Resta\Authenticate;
4
5
use Resta\Authenticate\Resource\AuthLoginCredentialsManager;
6
use Resta\Request\Request as RequestClient;
7
8
class AuthenticateRequest extends RequestClient
9
{
10
    /**
11
     * With the auto injector,
12
     * all the indices in the array are executed as methods
13
     * and the global input is automatically injected.
14
     *
15
     * @var array $autoInject
16
     */
17
    protected $autoInject = [];
18
19
    /**
20
     * The values ​​expected by the server.
21
     *
22
     * @var array
23
     */
24
    protected $expected = [];
25
26
    /**
27
     * mandatory http method.
28
     *
29
     * @var array
30
     */
31
    protected $http = [];
32
33
    /**
34
     * @var null|object
35
     */
36
    protected $credentials;
37
38
    /**
39
     * AuthenticateRequest constructor.
40
     * @param AuthLoginCredentialsManager $credentials
41
     */
42
    public function __construct($credentials)
43
    {
44
        $this->credentials = $credentials;
45
46
        //credentials loop for expected property
47
        foreach ($this->credentials->get() as $credential){
48
            $this->expected[] = $credential;
49
        }
50
51
        parent::__construct();
52
    }
53
54
    public function all()
55
    {
56
        return $this->inputs;
57
    }
58
59
    /**
60
     * @var string
61
     */
62
    protected $password;
63
64
    /**
65
     * @return string
66
     */
67
    protected function password()
68
    {
69
        return md5(sha1($this->password));
70
    }
71
}