| Conditions | 2 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __construct(Node\Scalar $scalar, Context $context) |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $context->getEventManager()->fire( |
||
| 36 | Event\ScalarBeforeCompile::EVENT_NAME, |
||
| 37 | new Event\ScalarBeforeCompile( |
||
| 38 | $scalar, |
||
| 39 | $context |
||
| 40 | ) |
||
| 41 | ); |
||
| 42 | |||
| 43 | $compiler = $this->factory($scalar); |
||
| 44 | } catch (\Exception $e) { |
||
| 45 | $context->debug('ScalarCompiler is not implemented for ' . get_class($scalar)); |
||
| 46 | return; |
||
| 47 | } |
||
| 48 | |||
| 49 | $compiler->pass($scalar, $context); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |