| Total Complexity | 8 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Printer implements PrinterInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var array|WriterInterface[] |
||
| 13 | */ |
||
| 14 | protected $writers; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Printer constructor. |
||
| 18 | * @param array|WriterInterface[] $writers |
||
| 19 | */ |
||
| 20 | public function __construct(array $writers) |
||
| 21 | { |
||
| 22 | foreach ($writers as $writer) { |
||
| 23 | $writer->setPrinter($this); |
||
| 24 | } |
||
| 25 | |||
| 26 | $this->writers = $writers; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @inheritdoc |
||
| 31 | * @throws LanguageException |
||
| 32 | */ |
||
| 33 | public function print(NodeInterface $node): string |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param NodeInterface $node |
||
| 44 | * @return WriterInterface|null |
||
| 45 | */ |
||
| 46 | protected function getWriter(NodeInterface $node): ?WriterInterface |
||
| 55 | } |
||
| 56 | } |
||
| 57 |