| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 1 | public function addCredential(string $key, string $value) : AuthCredentialInterface |
|
| 38 | { |
||
| 39 | switch ($key) { |
||
| 40 | 1 | case 'username': |
|
| 41 | 1 | $this->username = $value; |
|
| 42 | 1 | break; |
|
| 43 | |||
| 44 | 1 | case 'password': |
|
| 45 | 1 | $this->password = $value; |
|
| 46 | 1 | break; |
|
| 47 | |||
| 48 | default: |
||
| 49 | 1 | throw new InvalidArgumentException( |
|
| 50 | sprintf( |
||
| 51 | 1 | 'Parameter #1 must be either "usenrame" or "password", %s given.', |
|
| 52 | $key |
||
| 53 | ), |
||
| 54 | 1 | 1000 |
|
| 55 | ); |
||
| 56 | } |
||
| 57 | |||
| 58 | 1 | return $this; |
|
| 59 | } |
||
| 60 | |||
| 71 |