| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 34 | public function createInstanceFor($constraintName, EventDispatcherInterface $eventDispatcher = null) |
||
| 35 | { |
||
| 36 | $instance = parent::createInstanceFor($constraintName); |
||
| 37 | |||
| 38 | if (!is_null($eventDispatcher)) { |
||
| 39 | $this->dispatcher = $eventDispatcher; |
||
| 40 | } |
||
| 41 | |||
| 42 | if (!is_null($this->dispatcher) && is_callable([$instance, 'setEventDispatcher'])) { |
||
| 43 | $instance->setEventDispatcher($this->dispatcher); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $instance; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |