Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
39 | 17 | protected function validateClient($client, $clientName) |
|
40 | { |
||
41 | 17 | if (!$client) { |
|
42 | 1 | throw new \InvalidArgumentException(sprintf( |
|
43 | 1 | 'No client "%s" found', |
|
44 | $clientName |
||
45 | 1 | )); |
|
46 | } |
||
47 | |||
48 | 16 | if (!$client instanceof Client) { |
|
49 | 1 | throw new \InvalidArgumentException(sprintf( |
|
50 | 1 | 'Client "%s" should be instance of "%s"', |
|
51 | 1 | $clientName, |
|
52 | Client::class |
||
53 | 1 | )); |
|
54 | } |
||
55 | 15 | } |
|
56 | } |
||
57 |