From e5e92ca45403be10b4df5cf7b1b930e7609ac740 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:47:06 -0600 Subject: [PATCH 01/13] Fix Implicitly marking parameter as nullable --- src/Builders/Html2PdfBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Builders/Html2PdfBuilder.php b/src/Builders/Html2PdfBuilder.php index 60c9300..1fef243 100644 --- a/src/Builders/Html2PdfBuilder.php +++ b/src/Builders/Html2PdfBuilder.php @@ -20,7 +20,7 @@ class Html2PdfBuilder implements BuilderInterface * * @param HtmlTranslatorInterface|null $htmlTranslator If NULL will use a generic translator */ - public function __construct(HtmlTranslatorInterface $htmlTranslator = null) + public function __construct(?HtmlTranslatorInterface $htmlTranslator = null) { if (null === $htmlTranslator) { $htmlTranslator = new HtmlTranslators\PlatesHtmlTranslator( From f197912ab50e7d8d50844d38c0e76eb4cbe713d1 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:48:51 -0600 Subject: [PATCH 02/13] Help PHPStan with Stringable type --- src/Internal/CastToStringTrait.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Internal/CastToStringTrait.php b/src/Internal/CastToStringTrait.php index bf66717..202c726 100644 --- a/src/Internal/CastToStringTrait.php +++ b/src/Internal/CastToStringTrait.php @@ -17,10 +17,13 @@ private function strval($value): string if (is_string($value)) { return $value; } - if (null === $value || is_scalar($value) || (is_object($value) && is_callable([$value, '__toString']))) { - /** @phpstan-var null|scalar|Stringable $value */ + if (null === $value || is_scalar($value)) { return strval($value); } + if (is_object($value) && is_callable([$value, '__toString'])) { + /** @phpstan-var Stringable $value */ + return $value->__toString(); + } return ''; } } From a818d916c1e99a19ad33f548fb73119484a30c25 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:49:10 -0600 Subject: [PATCH 03/13] Update code standards --- .php-cs-fixer.dist.php | 4 ++-- phpcs.xml.dist | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 4d742d8..3688dd7 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,8 +15,8 @@ ->setRules([ '@PSR12' => true, '@PSR12:risky' => true, - '@PHP71Migration:risky' => true, - '@PHP73Migration' => true, + '@PHP7x1Migration:risky' => true, + '@PHP7x3Migration' => true, // basic 'statement_indentation' => false, // invalid indentation // symfony diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 1701fc1..784a7e0 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -21,7 +21,6 @@ - From f48d189b27d655177669fb582b87e8e6ed7e59fc Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:50:24 -0600 Subject: [PATCH 04/13] Allow install CfdiUtils v3.x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 510aa07..891c822 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "require": { "php": ">=7.3", - "eclipxe/cfdiutils": "^2.29", + "eclipxe/cfdiutils": "^2.29 || ^3.0", "league/plates": "^3.5", "phpcfdi/cfdi-cleaner": "^1.3.3", "spipu/html2pdf": "^5.2.8" From 484c08e0ec64738d25d260b03ad7ef4274b63b1c Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:50:41 -0600 Subject: [PATCH 05/13] Add PHP 8.4 to test matrix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcbb03e..3dd92ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout uses: actions/checkout@v4 From a8e3da093690e182370b3c30760e76fa27bdb877 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:51:11 -0600 Subject: [PATCH 06/13] Run jobs using PHP 8.4 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dd92ac..5256d0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none tools: composer-normalize env: @@ -40,7 +40,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none tools: cs2pr, phpcs env: @@ -57,7 +57,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none tools: cs2pr, php-cs-fixer env: @@ -74,7 +74,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none tools: composer:v2, phpstan extensions: soap, gd From 5fdf0a7f1825caf8ab898a24796fa6511bd20fbc Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:51:23 -0600 Subject: [PATCH 07/13] Fix composer-normalize check --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5256d0c..990c688 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: env: fail-fast: true - name: Composer normalize - run: composer-normalize + run: composer-normalize --dry-run phpcs: name: Code style (phpcs) From 432240e2efe559f9896270e0e526e41c7b7b2946 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:51:51 -0600 Subject: [PATCH 08/13] Reorder extensions parameter --- .github/workflows/build.yml | 4 ++-- .github/workflows/publish.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 990c688..cd3a0da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,9 +75,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.4' + extensions: soap, gd coverage: none tools: composer:v2, phpstan - extensions: soap, gd env: fail-fast: true - name: Get composer cache directory @@ -113,9 +113,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: soap, gd coverage: xdebug tools: composer:v2 - extensions: soap, gd env: fail-fast: true - name: Install SAT XML resources diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a4dda62..c37435c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,9 +22,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '7.3' # use minimal version + extensions: soap, gd coverage: none tools: composer:v2 - extensions: soap, gd env: fail-fast: true - name: "Get composer cache directory" From 070b7fe93ca10259aebdce9186ea6ca27e292795 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:52:07 -0600 Subject: [PATCH 09/13] Update license to 2025 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index faeedc7..e47647e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 - 2024 PhpCfdi https://www.phpcfdi.com/ +Copyright (c) 2018 - 2025 PhpCfdi https://www.phpcfdi.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 07712bbd8fe7165fff1418aaa80d643b29718cba Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:53:00 -0600 Subject: [PATCH 10/13] Update development tools --- .phive/phars.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index e294e91..0e415ad 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,8 +1,8 @@ - - - - - + + + + + From be8da5cd1e43cd86a632830b12c3dec9948554cd Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 21:58:04 -0600 Subject: [PATCH 11/13] Allow dependence of `eclipxe/cfdiutils:^2.31` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 891c822..b9225d7 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "require": { "php": ">=7.3", - "eclipxe/cfdiutils": "^2.29 || ^3.0", + "eclipxe/cfdiutils": "^2.31 || ^3.0", "league/plates": "^3.5", "phpcfdi/cfdi-cleaner": "^1.3.3", "spipu/html2pdf": "^5.2.8" From f561b63d0e7d2b88ccfc2dba423a0d44235df53d Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 22:01:34 -0600 Subject: [PATCH 12/13] Prepare version 0.4.3 --- docs/CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 240d484..d52b742 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,19 @@ # `phpcfdi/cfditopdf` Changelog +## Version 0.4.3 2024-11-08 + +- Fix compatibility with PHP 8.4. +- Allow dependence of `eclipxe/cfdiutils` to match versions `^2.31` and `^3.0`. +- Update license year to 2025. + +These changes apply to the development environment: + +- Update code standards for `phpcs` and `php-cs-fixer`. +- Add PHP 8.4 to test matrix. +- Run workflows jobs using PHP 8.4. +- Fix workflow job `composer-normalize`. It didn't fail on `composer.json` errors. +- Update development tools. + ## Version 0.4.2 2024-09-02 - Fix issue on CFDI 4.0 generate only the first block of information for `cfdi:CfdiRelacionados`. From 3948d7166c7f1aa2a5f632c5c2c61ac1da4cc23b Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Sat, 8 Nov 2025 22:08:32 -0600 Subject: [PATCH 13/13] Update composer version 2 on Scrutinizer-CI --- .scrutinizer.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 6088510..7b8c5f9 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -6,6 +6,11 @@ filter: # see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/ build: dependencies: + before: + - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + - php composer-setup.php --install-dir=$HOME/bin --filename=composer + - php -r "unlink('composer-setup.php');" + - $HOME/bin/composer --version override: - composer update --no-interaction nodes: