| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 28 | public function __construct(MethodInvocation $invocation, $contract, Throwable $previous = null) |
|
| 33 | { |
||
| 34 | 28 | $obj = $invocation->getThis(); |
|
| 35 | 28 | $objName = \is_object($obj) ? \get_class($obj) : $obj; |
|
| 36 | 28 | $method = $invocation->getMethod(); |
|
| 37 | 28 | $args = \implode(', ', $invocation->getArguments()); |
|
| 38 | |||
| 39 | 28 | $message = "Contract {$contract} violated with argument set {{$args}} for {$objName}->{$method->name}"; |
|
| 40 | 28 | parent::__construct($message, 0, $previous); |
|
| 41 | |||
| 42 | 28 | $this->file = $method->getFileName(); |
|
| 43 | 28 | $this->line = $method->getStartLine() + 1; |
|
| 44 | 28 | } |
|
| 45 | } |
||
| 46 |