From 505f3be3b8c199cc3388d1bcd0a7dbc6562979f5 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:17:12 -0600 Subject: [PATCH 01/19] Exclude /.phive/ from git package --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 1285aca..9d84905 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,6 +8,7 @@ # Do not put this files on a distribution package /.github/ export-ignore +/.phive/ export-ignore /build/ export-ignore /tests/ export-ignore /.gitattributes export-ignore From 756fadb47424c287f34fd30baacab951935878ea Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:17:27 -0600 Subject: [PATCH 02/19] Update license year to 2026 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5b8acbe..4278bd5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 - 2025 PhpCfdi https://www.phpcfdi.com/ +Copyright (c) 2019 - 2026 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 716360bac5eaa8e834bec9a972d612c96e50ccbe Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:17:58 -0600 Subject: [PATCH 03/19] Fix composer-normalize to fail when needed --- .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 daf8faf..98e970d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: env: fail-fast: true - name: Composer normalize - run: composer-normalize + run: composer-normalize --dry-run phpcs: name: Code style (phpcs) From 32481b385b79041309e93b4a4a6cd5c0318311be Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:19:38 -0600 Subject: [PATCH 04/19] Rename job names and descriptions --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98e970d..3d8cb27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: run: composer-normalize --dry-run phpcs: - name: Code style (phpcs) + name: Coding standards (phpcs) runs-on: "ubuntu-latest" steps: - name: Checkout @@ -48,7 +48,7 @@ jobs: run: phpcs -q --report=checkstyle | cs2pr php-cs-fixer: - name: Code style (php-cs-fixer) + name: Coding standards (php-cs-fixer) runs-on: "ubuntu-latest" steps: - name: Checkout @@ -92,7 +92,7 @@ jobs: - name: PHPStan run: phpstan analyse --no-progress --verbose - tests: + phpunit: name: Tests on PHP ${{ matrix.php-version }} runs-on: "ubuntu-latest" strategy: From b2f49fa66f1c49aec686a35ca3001f2e4fcf6484 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:20:47 -0600 Subject: [PATCH 05/19] Run jobs using PHP 8.5 --- .github/workflows/build.yml | 8 ++++---- .github/workflows/sonarqube-cloud.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d8cb27..bed2ef2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer-normalize env: @@ -39,7 +39,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: cs2pr, phpcs env: @@ -56,7 +56,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.5' coverage: none tools: cs2pr, php-cs-fixer env: @@ -73,7 +73,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2, phpstan env: diff --git a/.github/workflows/sonarqube-cloud.yml b/.github/workflows/sonarqube-cloud.yml index 5f098d8..9d27c8e 100644 --- a/.github/workflows/sonarqube-cloud.yml +++ b/.github/workflows/sonarqube-cloud.yml @@ -27,7 +27,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: xdebug tools: composer:v2 - name: Get composer cache directory From 20a320e4723dea3cc7f1920de7ec9932dc337f54 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:22:46 -0600 Subject: [PATCH 06/19] Update GitHub actions versions --- .github/workflows/build.yml | 14 +++++++------- .github/workflows/sonarqube-cloud.yml | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bed2ef2..f292f6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -35,7 +35,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -52,7 +52,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -69,7 +69,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -82,7 +82,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -100,7 +100,7 @@ jobs: php-version: ['8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -113,7 +113,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/sonarqube-cloud.yml b/.github/workflows/sonarqube-cloud.yml index 9d27c8e..142d99c 100644 --- a/.github/workflows/sonarqube-cloud.yml +++ b/.github/workflows/sonarqube-cloud.yml @@ -6,7 +6,7 @@ on: # Actions # shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action -# SonarSource/sonarqube-scan-action@v5 https://github.com/marketplace/actions/official-sonarqube-scan +# SonarSource/sonarqube-scan-action@v8 https://github.com/marketplace/actions/official-sonarqube-scan jobs: @@ -21,7 +21,7 @@ jobs: exit 1 fi - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Unshallow clone to provide blame information run: git fetch --unshallow - name: Setup PHP @@ -34,7 +34,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -48,6 +48,6 @@ jobs: sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/junit.xml > build/sonar-junit.xml sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/clover.xml > build/sonar-coverage.xml - name: SonarCloud Scan - uses: SonarSource/sonarqube-scan-action@v5 + uses: SonarSource/sonarqube-scan-action@v8 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From d44363a4a976d560c1539bf62f4c9ad67d77a84d Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:23:26 -0600 Subject: [PATCH 07/19] Add PHP 8.5 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 f292f6f..eb55556 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,7 +97,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout uses: actions/checkout@v7 From a17d0982cc52c67554a93a90b4d297bed4ca60eb Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:24:04 -0600 Subject: [PATCH 08/19] 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 ff3bfe0..d6398d7 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,8 +1,8 @@ - - - - - + + + + + From 2cce7a47bdafa66216311db7317db8dce4843e27 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:24:35 -0600 Subject: [PATCH 09/19] Update deprecated rule sets --- .php-cs-fixer.dist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 856ebb3..eecfabf 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,8 +15,8 @@ ->setRules([ '@PSR12' => true, '@PSR12:risky' => true, - '@PHP81Migration' => true, - '@PHP80Migration:risky' => true, + '@PHP8x1Migration' => true, + '@PHP8x0Migration:risky' => true, // symfony 'array_indentation' => true, 'class_attributes_separation' => true, From 7abcebae685150a61254c68aed530dfc9ad28ec5 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:31:34 -0600 Subject: [PATCH 10/19] Fix PHPStan issue not knowing that preg_grep result is an strings array --- src/Certificate.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Certificate.php b/src/Certificate.php index d1ea9b6..dd1ddf5 100644 --- a/src/Certificate.php +++ b/src/Certificate.php @@ -89,7 +89,9 @@ public function pem(): string public function pemAsOneLine(): string { - return implode('', preg_grep('/^((?!-).)*$/', explode(PHP_EOL, $this->pem())) ?: []); + /** @phpstan-var string[]|false $lines */ + $lines = preg_grep('/^((?!-).)*$/', explode(PHP_EOL, $this->pem())); + return implode('', $lines ?: []); } /** From d3500ac2b39414f5a6f807bca6a970f712dea7cc Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 21:36:15 -0600 Subject: [PATCH 11/19] Update eclipxe/enum dependency to 0.2.8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d6f209e..a20e55d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "php": ">=8.1", "ext-mbstring": "*", "ext-openssl": "*", - "eclipxe/enum": "^0.2.7" + "eclipxe/enum": "^0.2.8" }, "require-dev": { "ext-json": "*", From 677cecc98f4d5bdc53db75b8147a0684fa9499c9 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:07:40 -0600 Subject: [PATCH 12/19] Allow run phpcbf to fail --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a20e55d..a29ac75 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "dev:fix-style": [ "@php tools/composer-normalize normalize", "@php tools/php-cs-fixer fix --verbose", - "@php tools/phpcbf --colors -sp" + "@php tools/phpcbf --colors -sp || true" ], "dev:test": [ "@php vendor/bin/phpunit --testdox --stop-on-failure", From 7d85869a74d7e2d3a090c9f59716d647fcc03a0b Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:08:18 -0600 Subject: [PATCH 13/19] Be clear of short_names argument --- src/Certificate.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Certificate.php b/src/Certificate.php index dd1ddf5..8f859ac 100644 --- a/src/Certificate.php +++ b/src/Certificate.php @@ -45,7 +45,8 @@ public function __construct(string $contents) $pem = static::convertDerToPem($contents); } - $parsed = openssl_x509_parse($pem, true); + /** @noinspection PhpRedundantOptionalArgumentInspection */ + $parsed = openssl_x509_parse($pem, short_names: true); if (false === $parsed) { throw new UnexpectedValueException('Cannot parse X509 certificate from contents'); } From e0442b85bd030b87ade18ef8b1cdbc7bd014fc2d Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:08:48 -0600 Subject: [PATCH 14/19] Remove unnecessary cast --- src/Certificate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Certificate.php b/src/Certificate.php index 8f859ac..eec5e54 100644 --- a/src/Certificate.php +++ b/src/Certificate.php @@ -131,7 +131,7 @@ public function subject(): array public function subjectData(string $key): string { - return strval($this->subject()[$key] ?? ''); + return $this->subject()[$key] ?? ''; } public function hash(): string @@ -147,7 +147,7 @@ public function issuer(): array public function issuerData(string $string): string { - return strval($this->issuer()[$string] ?? ''); + return $this->issuer()[$string] ?? ''; } public function version(): string From 99fd9b93620f48aba874c6f11c71ac4ab20d4838 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:09:20 -0600 Subject: [PATCH 15/19] Use scalar type & simplify return for extractScalar --- src/Internal/DataArrayTrait.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Internal/DataArrayTrait.php b/src/Internal/DataArrayTrait.php index b1a3e81..b6e450a 100644 --- a/src/Internal/DataArrayTrait.php +++ b/src/Internal/DataArrayTrait.php @@ -10,19 +10,16 @@ trait DataArrayTrait { /** @var array content of openssl_x509_parse or openssl_pkey_get_details */ - protected $dataArray; + protected array $dataArray; /** - * @param string|int|float|bool $default - * @return string|int|float|bool + * @param scalar $default + * @return scalar */ protected function extractScalar(string $key, $default) { $value = $this->dataArray[$key] ?? $default; - if (is_scalar($value)) { - return $value; - } - return $default; + return is_scalar($value) ? $value : $default; } protected function extractString(string $key): string From 81da4fcb38d3b16fef86be1da48df58c9065c33d Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:10:48 -0600 Subject: [PATCH 16/19] Use OpenSSLAsymmetricKey available since PHP 8.0 --- src/PrivateKey.php | 10 ++++++---- src/PublicKey.php | 15 ++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/PrivateKey.php b/src/PrivateKey.php index cae550c..54d47c4 100644 --- a/src/PrivateKey.php +++ b/src/PrivateKey.php @@ -111,12 +111,14 @@ function ($privateKey) use ($data, $algorithm): string { /** * This method id created to wrap and mock openssl_sign - * - * @param OpenSSLAsymmetricKey $privateKey * @internal */ - protected function openSslSign(string $data, ?string &$signature, $privateKey, int $algorithm): bool - { + protected function openSslSign( + string $data, + string|null &$signature, + OpenSSLAsymmetricKey $privateKey, + int $algorithm, + ): bool { return openssl_sign($data, $signature, $privateKey, $algorithm); // @phpstan-ignore parameterByRef.type } diff --git a/src/PublicKey.php b/src/PublicKey.php index 73226f8..865c5b1 100644 --- a/src/PublicKey.php +++ b/src/PublicKey.php @@ -33,8 +33,6 @@ public static function openFile(string $filename): self /** * Verify the signature of some data * - * - * * @throws RuntimeException when openssl report an error on verify */ public function verify(string $data, string $signature, int $algorithm = OPENSSL_ALGO_SHA256): bool @@ -52,12 +50,15 @@ function ($publicKey) use ($data, $signature, $algorithm): bool { } /** - * This method id created to wrap and mock openssl_verify - * - * @param OpenSSLAsymmetricKey $publicKey + * This method is created to wrap and mock openssl_verify + * @internal */ - protected function openSslVerify(string $data, string $signature, $publicKey, int $algorithm): int - { + protected function openSslVerify( + string $data, + string $signature, + OpenSSLAsymmetricKey $publicKey, + int $algorithm, + ): int { $verify = openssl_verify($data, $signature, $publicKey, $algorithm); if (false === $verify) { return -1; // @codeCoverageIgnore From 3b2ff83acee51f7826c8b72fa13fc7ff14679328 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:11:05 -0600 Subject: [PATCH 17/19] Remove set default parameter --- src/Internal/LocalFileOpenTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Internal/LocalFileOpenTrait.php b/src/Internal/LocalFileOpenTrait.php index 0fb5d8c..3dbe159 100644 --- a/src/Internal/LocalFileOpenTrait.php +++ b/src/Internal/LocalFileOpenTrait.php @@ -31,7 +31,7 @@ private static function localFileOpen(string $filename): string } /** @noinspection PhpUsageOfSilenceOperatorInspection */ - $contents = @file_get_contents($path, false) ?: ''; + $contents = @file_get_contents($path) ?: ''; if ('' === $contents) { throw new RuntimeException('File content is empty'); } From c43a4290872592e052aeae740a7697161779070e Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:11:27 -0600 Subject: [PATCH 18/19] Remove PHPStorm "unused" inspection --- src/Internal/OpenSslKeyTypeEnum.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Internal/OpenSslKeyTypeEnum.php b/src/Internal/OpenSslKeyTypeEnum.php index e836332..6e43777 100644 --- a/src/Internal/OpenSslKeyTypeEnum.php +++ b/src/Internal/OpenSslKeyTypeEnum.php @@ -27,6 +27,7 @@ final class OpenSslKeyTypeEnum extends Enum * * @return array * @noinspection PhpMissingParentCallCommonInspection + * @noinspection PhpUnused */ protected static function overrideIndices(): array { From ba9616d1be65b52dd44234c02294acb4ef9eee0b Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Fri, 23 Oct 2026 22:15:51 -0600 Subject: [PATCH 19/19] Prepare version 1.3.1 --- docs/CHANGELOG.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 48061d3..c57e9d5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,15 +9,36 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr Pueden aparecer cambios no liberados que se integran a la rama principal, pero no ameritan una nueva liberación de versión, aunque sí su incorporación en la rama principal de trabajo. Generalmente, se tratan de cambios en el desarrollo. -### Mantenimiento 2025-09-25 +## Listado de cambios + +### Versión 1.3.1 2026-10-23 + +- Se actualiza el año de la licencia a 2026. +- Se actualizó la dependencia `eclipxe/enum` a 0.2.8. +- Se garantiza la compatibilidad con PHP 8.5. +- Se excluye el directorio `.phive` del paquete Git. +- Se usa el tipo `OpenSSLAsymmetricKey` disponible desde PHP 8.0. +- Se solucionan pequeñas incidencias reportadas por la inspección de PHPStorm. + +En el entorno de desarrollo: + +- Se actualiza el código para corregir un falso positivo de PHPStan. +- Se actualizan las reglas deprecadas de `php-cs-fixer`. +- En los flujos de trabajo de GitHub: + - Se corrige el trabajo `composer-normalize` para que falle cuando es necesario. + - Se actualizan las versiones de las acciones. + - Se agrega PHP 8.5 a la matriz de pruebas. + - Se ejecutan los trabajos en PHP 8.5. + - Se renombra el trabajo `tests` a `phpunit`. +- Se actualizan las herramientas de desarrollo. + +#### Mantenimiento 2025-09-25 - Se actualizan las herramientas `phpcs` y `phpcbf` a la versión 4.0.0. - Se elimina la regla `Generic.Functions.CallTimePassByReference`. - Se moderniza la integración con SonarQube-Cloud. - Se actualiza `sonarqube-scan-action` a la versión 6. -## Listado de cambios - ### Versión 1.3.0 2025-04-12 - Se mejoran las declaraciones de tipos.