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