| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 2 | public function __construct($class = self::DEFAULT_CLASS) |
|
| 26 | { |
||
| 27 | 2 | $interface = 'Ajir\RabbitMqSqlBundle\DataStructure\Message\AMQPMessageInterface'; |
|
| 28 | 2 | $this->class = new \ReflectionClass($class); |
|
| 29 | |||
| 30 | 2 | if (!$this->class->implementsInterface($interface)) { |
|
| 31 | 1 | throw new \InvalidArgumentException( |
|
| 32 | sprintf( |
||
| 33 | 1 | "'%s' should implements %s", |
|
| 34 | 1 | $this->class->getName(), |
|
| 35 | $interface |
||
| 36 | ) |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | 1 | } |
|
| 40 | |||
| 49 |