-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from eclipxe13/master
Version 0.3.3
- Loading branch information
Showing
24 changed files
with
247 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# do not include this files on git | ||
/vendor | ||
/build | ||
/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
# phpcfdi/cfditopdf To Do List | ||
|
||
- [X] Otros nodos de los conceptos | ||
- [X] Cadena de origen del TFD | ||
- [X] Liga del código QR | ||
- [X] Formato del código QR | ||
- [X] Construcción de objetos | ||
- [ ] Catálogos para expresar las claves | ||
- [ ] Impresión genérica de complementos | ||
- [ ] Crear nuevos métodos para generar el archivo PDF | ||
- [X] Depend on new version of CfdiUtils | ||
- [X] Move PdfToText to a different library and require it only on development | ||
- [X] Improve testing | ||
- [X] When macfja/phar-builder reaches phive move it from composer script requiere run remove | ||
to phive dependence | ||
Intro: Al completar una tarea pasarla de *Planeada* a *Finalizada*. Escribir fecha o versión del cambio. | ||
|
||
# Planeadas | ||
|
||
- Revisar que <https://github.com/spipu/html2pdf/issues/530> esté solucionado para desactivar "permitir fallos" | ||
en PHP 7.4 porque `spipu/html2pdf` tiene un bug. | ||
- Cambiar a PHP 7.2 o mayor. | ||
- Al cambiar de versión de PHP, actualizar los métodos que retornan void a que explícitamente lo hangan. | ||
- Modificar `NodeInterface<NodeInterface>` para cuando `eclipxe/cfdiutils` ya lo incluya por sí mismo. | ||
- Catálogos para expresar las claves. | ||
- Impresión genérica de complementos. | ||
- Crear nuevos métodos para generar el archivo PDF. | ||
|
||
## Finalizadas | ||
|
||
### En versión 0.3.2 o anteriores: | ||
|
||
- Otros nodos de los conceptos. | ||
- Cadena de origen del TFD. | ||
- Liga del código QR. | ||
- Formato del código QR. | ||
- Construcción de objetos. | ||
- Depend on new version of CfdiUtils. | ||
- Move PdfToText to a different library and require it only on development. | ||
- Improve testing. | ||
- When macfja/phar-builder reaches phive move it from composer script requiere run remove to phive dependence. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
parameters: | ||
inferPrivatePropertyTypeFromConstructor: true | ||
ignoreErrors: | ||
- '#Method PhpCfdi\\CfdiToPdf\\Tests\\\S+::test\S+ has no return typehint specified\.#' | ||
- '#Method PhpCfdi\\CfdiToPdf\\Tests\\\S+::(setUp|tearDown)\(\) has no return typehint specified\.#' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\CfdiToPdf\Builders\HtmlTranslators; | ||
|
||
use PhpCfdi\CfdiToPdf\CfdiData; | ||
|
||
interface HtmlTranslatorInterface | ||
{ | ||
/** | ||
* Transform CfdiData contents to HTML content | ||
* | ||
* @param CfdiData $cfdiData | ||
* @return string | ||
*/ | ||
public function translate(CfdiData $cfdiData): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\CfdiToPdf\Builders\HtmlTranslators; | ||
|
||
use League\Plates\Engine as PlatesEngine; | ||
use PhpCfdi\CfdiToPdf\CfdiData; | ||
|
||
class PlatesHtmlTranslator implements HtmlTranslatorInterface | ||
{ | ||
/** @var string */ | ||
private $directory; | ||
|
||
/** @var string */ | ||
private $template; | ||
|
||
/** | ||
* PlatesHtmlTranslator constructor. | ||
* | ||
* @param string $directory | ||
* @param string $template | ||
*/ | ||
public function __construct(string $directory, string $template) | ||
{ | ||
$this->directory = $directory; | ||
$this->template = $template; | ||
} | ||
|
||
public function translate(CfdiData $cfdiData): string | ||
{ | ||
// __DIR__ is src/Builders | ||
$plates = new PlatesEngine($this->directory()); | ||
return $plates->render($this->template(), ['cfdiData' => $cfdiData]); | ||
} | ||
|
||
public function directory(): string | ||
{ | ||
return $this->directory; | ||
} | ||
|
||
public function template(): string | ||
{ | ||
return $this->template; | ||
} | ||
} |
Oops, something went wrong.