| Conditions | 7 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 7.2944 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 40 | 10 | public function __construct( $username, $password, $domain = null ) { |
|
| 41 | 10 | if( !is_string( $username ) || !is_string( $password ) || !( is_null( $domain ) || is_string( $domain ) ) ) { |
|
| 42 | 5 | throw new InvalidArgumentException( 'Username, Password and Domain must all be strings' ); |
|
| 43 | } |
||
| 44 | 5 | if( empty( $username ) || empty( $password ) ) { |
|
| 45 | 3 | throw new InvalidArgumentException( 'Username and Password are not allowed to be empty' ); |
|
| 46 | } |
||
| 47 | 2 | $this->username = $username; |
|
| 48 | 2 | $this->password = $password; |
|
| 49 | 2 | $this->domain = $domain; |
|
| 50 | 2 | } |
|
| 51 | |||
| 90 |