Conditions | 4 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 2 | public function add($table) { |
|
27 | 2 | if (!is_object($table) || get_class($table) !== 'Zortje\MySQLKeeper\Database\Table') { |
|
28 | 1 | $argumentType = is_object($table) ? get_class($table) : gettype($table); |
|
29 | |||
30 | 1 | throw new \InvalidArgumentException(sprintf('Collection may only contain "%s" objects, "%s" is not allowed', 'Zortje\MySQLKeeper\Database\Table', $argumentType)); |
|
31 | } |
||
32 | |||
33 | 1 | $this->collection[] = $table; |
|
34 | 1 | } |
|
35 | } |
||
36 |