Completed
Push — master ( 89bda5...038609 )
by
unknown
06:35
created

SetUsernameAndPassword::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Net\Bazzline\Component\Curl\Option\Authentication;
4
5
use Net\Bazzline\Component\Curl\Option\OptionInterface;
6
7
class SetUsernameAndPassword implements OptionInterface
8
{
9
    /** @var string */
10
    private $password;
11
12
    /** @var string */
13
    private $username;
14
15
    /**
16
     * @param string $username
17
     * @param string $password
18
     */
19
    public function __construct($username, $password)
20
    {
21
        $this->password = $password;
22
        $this->username = $username;
23
    }
24
25
    /**
26
     * @return int
27
     */
28
    public function identifier()
29
    {
30
        return CURLOPT_USERPWD;
31
    }
32
33
    /**
34
     * @return mixed
35
     */
36
    public function value()
37
    {
38
        return $this->username . ':' . $this->password;
39
    }
40
}