| Total Complexity | 4 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class HttpClientAuthentication |
||
| 20 | { |
||
| 21 | public const AUTH_BASIC = CURLAUTH_BASIC; |
||
| 22 | public const AUTH_DIGEST = CURLAUTH_DIGEST; |
||
| 23 | public const AUTH_NTLM = CURLAUTH_NTLM; |
||
| 24 | public const AUTH_ANY = CURLAUTH_ANY; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $username; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | private $password; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var int |
||
| 38 | */ |
||
| 39 | private $type; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Creates an HTTP Client Authentication |
||
| 43 | * |
||
| 44 | * @param string $username |
||
| 45 | * @param string $password |
||
| 46 | * @param int $type |
||
| 47 | */ |
||
| 48 | public function __construct($username, $password, $type = self::AUTH_ANY) |
||
| 49 | { |
||
| 50 | $this->username = $username; |
||
| 51 | $this->password = $password; |
||
| 52 | $this->type = $type; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * User's name |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function username() |
||
| 61 | { |
||
| 62 | return $this->username; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * User's password |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function password() |
||
| 71 | { |
||
| 72 | return $this->password; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Authentication type |
||
| 77 | * |
||
| 78 | * @return int |
||
| 79 | */ |
||
| 80 | public function type() |
||
| 83 | } |
||
| 84 | } |
||
| 85 |