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

SetUsernameAndPassword   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A identifier() 0 4 1
A value() 0 4 1
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
}