| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class PlatesHtmlTranslator implements HtmlTranslatorInterface |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | private $directory; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | private $template; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * PlatesHtmlTranslator constructor. |
||
| 20 | * |
||
| 21 | * @param string $directory |
||
| 22 | * @param string $template |
||
| 23 | */ |
||
| 24 | 1 | public function __construct(string $directory, string $template) |
|
| 25 | { |
||
| 26 | 1 | $this->directory = $directory; |
|
| 27 | 1 | $this->template = $template; |
|
| 28 | } |
||
| 29 | |||
| 30 | 1 | public function translate(CfdiData $cfdiData): string |
|
| 31 | { |
||
| 32 | // __DIR__ is src/Builders |
||
| 33 | 1 | $plates = new PlatesEngine($this->directory()); |
|
| 34 | 1 | return $plates->render($this->template(), ['cfdiData' => $cfdiData]); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | public function directory(): string |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function template(): string |
|
| 47 |