From 65524d15a0530e6af4c94cdfff2566eda2059237 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:23:28 -0600 Subject: [PATCH 01/19] Remove old way to integrate with SonarQube --- .github/workflows/coverage.yml | 109 --------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index ece3b5b..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: coverage -on: - workflow_dispatch: - push: - branches: [ "main" ] - -# Actions -# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action -# sonarsource/sonarcloud-github-action@master https://github.com/marketplace/actions/sonarcloud-scan - -jobs: - - tests-coverage: - name: Tests on PHP 8.3 (code coverage) - runs-on: "ubuntu-latest" - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - coverage: xdebug - tools: composer:v2 - env: - fail-fast: true - - name: Get composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install project dependencies - run: composer upgrade --no-interaction --no-progress --prefer-dist - - name: Create code coverage - run: vendor/bin/phpunit --testdox --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml - - name: Store code coverage - uses: actions/upload-artifact@v3 - with: - name: code-coverage - path: build/coverage - - sonarcloud-secrets: - name: SonarCloud check secrets are present - runs-on: ubuntu-latest - outputs: - github: ${{ steps.check-secrets.outputs.github }} - sonar: ${{ steps.check-secrets.outputs.sonar }} - steps: - - name: Check secrets are present - id: check-secrets - run: | - if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then - echo "github=yes" >> $GITHUB_OUTPUT - else - echo "github=no" >> $GITHUB_OUTPUT - echo "::warning ::GITHUB_TOKEN non set" - fi - if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then - echo "sonar=yes" >> $GITHUB_OUTPUT - else - echo "sonar=no" >> $GITHUB_OUTPUT - echo "::warning ::SONAR_TOKEN non set" - fi - - sonarcloud: - name: SonarCloud Scan and Report - needs: [ "tests-coverage", "sonarcloud-secrets" ] - if: ${{ needs.sonarcloud-secrets.outputs.github == 'yes' && needs.sonarcloud-secrets.outputs.sonar == 'yes' }} - runs-on: "ubuntu-latest" - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Unshallow clone to provide blame information - run: git fetch --unshallow - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - coverage: none - tools: composer:v2 - - name: Get composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install project dependencies - run: composer upgrade --no-interaction --no-progress --prefer-dist - - name: Obtain code coverage - uses: actions/download-artifact@v3 - with: - name: code-coverage - path: build/coverage - - name: Prepare SonarCloud Code Coverage Files - run: | - 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/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 839cfe1df56b14f9dc4168d67c2eb2b61d0cc73b Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:24:10 -0600 Subject: [PATCH 02/19] Update lo latest GitHub actions --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d907290..5564322 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -34,7 +34,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -54,7 +54,7 @@ jobs: php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -68,7 +68,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -83,7 +83,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -97,7 +97,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} From 8c77dfd7ab9a4082dbdddb41fe339dead3bc6ef7 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:24:49 -0600 Subject: [PATCH 03/19] Remove test on PHP 7.4, add PHP 8.4 and PHP 8.5 --- .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 5564322..7ffb1fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout uses: actions/checkout@v6 From ee8f7c73c48793b9f1da6f039486ac25ae33d2ce Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:25:06 -0600 Subject: [PATCH 04/19] Run jobs using PHP 8.5 --- .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 7ffb1fd..966c377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.5' coverage: none tools: cs2pr, phpcs env: @@ -38,7 +38,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: @@ -87,7 +87,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.5' extensions: bcmath coverage: none tools: composer:v2, phpstan From 9706ead08119fbe8134c1fddda11ae20178aed48 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:25:23 -0600 Subject: [PATCH 05/19] Set minimal version to PHP 8.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c5822e4..076e6de 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.0", "ext-bcmath": "*", "ext-openssl": "*", "ext-dom": "*", From 38fc49e25bae264864a0f5726e527db62f699abd Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:25:53 -0600 Subject: [PATCH 06/19] Update eclipxe and phpcfdi dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 076e6de..11cddfd 100644 --- a/composer.json +++ b/composer.json @@ -25,10 +25,10 @@ "ext-bcmath": "*", "ext-openssl": "*", "ext-dom": "*", - "eclipxe/cfdiutils": "^v2.23.3", - "eclipxe/xmlresourceretriever": "^1.3.2", - "eclipxe/xmlschemavalidator": "^3.0.2", - "phpcfdi/credentials": "^1.1.3" + "eclipxe/cfdiutils": "^3.0.2", + "eclipxe/xmlresourceretriever": "^2.0.3", + "eclipxe/xmlschemavalidator": "^3.0.5", + "phpcfdi/credentials": "^1.3.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.15", From 27e2326752ca181733cd3933c4a8e0dff9702c63 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:26:04 -0600 Subject: [PATCH 07/19] Update license year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ed6db39..4918b61 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 - 2023 PhpCfdi https://www.phpcfdi.com/ +Copyright (c) 2021 - 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 33ebe97fcc445e32b8aa64bfcfc670db75ba40f9 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:26:26 -0600 Subject: [PATCH 08/19] Remove deprecated rule CallTimePassByReference Generic.Functions.CallTimePassByReference --- phpcs.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e7a9c2a..f7ec9c1 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -18,7 +18,6 @@ - From 2b67f1dea6ff62210ba226a8df0ae0b385ed59bc Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:27:03 -0600 Subject: [PATCH 09/19] Fix XsdRetriever FQN --- src/Validate/Common/BaseDocumentFollowSchemas.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Validate/Common/BaseDocumentFollowSchemas.php b/src/Validate/Common/BaseDocumentFollowSchemas.php index 177ed0f..60c9eba 100644 --- a/src/Validate/Common/BaseDocumentFollowSchemas.php +++ b/src/Validate/Common/BaseDocumentFollowSchemas.php @@ -13,12 +13,12 @@ use CfdiUtils\Validate\Traits\XmlStringPropertyTrait; use CfdiUtils\XmlResolver\XmlResolver; use CfdiUtils\XmlResolver\XmlResolverPropertyTrait; +use Eclipxe\XmlResourceRetriever\XsdRetriever; use Eclipxe\XmlSchemaValidator\Exceptions\ValidationFailException; use Eclipxe\XmlSchemaValidator\Schema; use Eclipxe\XmlSchemaValidator\Schemas; use Eclipxe\XmlSchemaValidator\SchemaValidator; use PhpCfdi\CeUtils\Validate\ValidatorInterface; -use XmlResourceRetriever\XsdRetriever; abstract class BaseDocumentFollowSchemas implements ValidatorInterface, From a946b658ef66ebe3ba430d1af7b6f773e7a50a22 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:27:57 -0600 Subject: [PATCH 10/19] Add composer-normalize tool --- .github/workflows/build.yml | 18 ++++++++++++++++++ .phive/phars.xml | 2 +- composer.json | 6 ++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 966c377..a3a2f77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,24 @@ on: # shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action jobs: + + composer-normalize: + name: Composer normalization + runs-on: "ubuntu-latest" + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + coverage: none + tools: composer-normalize + env: + fail-fast: true + - name: Composer normalize + run: composer-normalize --dry-run + phpcs: name: Coding standards (phpcs) runs-on: "ubuntu-latest" diff --git a/.phive/phars.xml b/.phive/phars.xml index 92b7c00..e98277b 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,6 +1,6 @@ - + diff --git a/composer.json b/composer.json index 11cddfd..fdc7e26 100644 --- a/composer.json +++ b/composer.json @@ -51,6 +51,7 @@ }, "scripts": { "dev:build": [ + "@php tools/composer-normalize normalize --dry-run", "@dev:fix-style", "@dev:test" ], @@ -62,6 +63,7 @@ "@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/" ], "dev:fix-style": [ + "@php tools/composer-normalize normalize", "@php tools/php-cs-fixer fix --verbose", "@php tools/phpcbf --colors -sp" ], @@ -73,9 +75,9 @@ }, "scripts-descriptions": { "dev:build": "DEV: run dev:fix-style and dev:tests, run before pull request", - "dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs", + "dev:check-style": "DEV: search for code style errors using composer-normalize, php-cs-fixer and phpcs", "dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/", - "dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf", + "dev:fix-style": "DEV: fix code style errors using composer-normalize, php-cs-fixer and phpcbf", "dev:test": "DEV: run dev:check-style, phpunit and phpstan" } } From b61f9a3480be76951c47a2d2e37930b06387e2dc Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:33:15 -0600 Subject: [PATCH 11/19] Normalize composer --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index fdc7e26..98d7357 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "phpcfdi/ceutils", "description": "PHP library for Mexican SAT Electronic Accounting 1.3", + "license": "MIT", "keywords": [ "mexico", "sat", @@ -8,8 +9,6 @@ "póliza", "balanza" ], - "homepage": "https://github.com/PhpCfdi/CeUtils", - "license": "MIT", "authors": [ { "name": "Cesar Aguilera", @@ -20,11 +19,12 @@ "email": "eclipxe13@gmail.com" } ], + "homepage": "https://github.com/PhpCfdi/CeUtils", "require": { "php": ">=8.0", "ext-bcmath": "*", - "ext-openssl": "*", "ext-dom": "*", + "ext-openssl": "*", "eclipxe/cfdiutils": "^3.0.2", "eclipxe/xmlresourceretriever": "^2.0.3", "eclipxe/xmlschemavalidator": "^3.0.5", From 3e22a55a32d9f5adfbb96fe70f68c3e445566a0b Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:33:48 -0600 Subject: [PATCH 12/19] Update development tools --- .phive/phars.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index e98277b..5790859 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,7 +1,8 @@ - - - + + + + From 35a3aec683b27f1115872e57ee62284823bb6a98 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:33:34 -0600 Subject: [PATCH 13/19] Update code standards (php-cs-fixer) --- .php-cs-fixer.dist.php | 6 +++--- src/Validate/Common/BaseDifferentRfc.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 176eb9b..67692fe 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,15 +15,15 @@ ->setRules([ '@PSR12' => true, '@PSR12:risky' => true, - '@PHP74Migration' => true, - '@PHP74Migration:risky' => true, + '@PHP8x0Migration' => true, + '@PHP8x0Migration:risky' => true, // symfony 'class_attributes_separation' => true, 'whitespace_after_comma_in_array' => true, 'no_empty_statement' => true, 'no_extra_blank_lines' => true, 'type_declaration_spaces' => true, - 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'arguments']], + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'arguments', 'parameters']], 'no_blank_lines_after_phpdoc' => true, 'object_operator_without_whitespace' => true, 'binary_operator_spaces' => true, diff --git a/src/Validate/Common/BaseDifferentRfc.php b/src/Validate/Common/BaseDifferentRfc.php index 06243fc..ddcd81c 100644 --- a/src/Validate/Common/BaseDifferentRfc.php +++ b/src/Validate/Common/BaseDifferentRfc.php @@ -47,7 +47,7 @@ private function validateNode( NodeInterface $node, Asserts $asserts, string $location, - int $count + int $count, ): void { $rfc = $node['RFC']; $asserts->put( From 5a8b245919de9c07167f584d23f7522364b1ea16 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:37:03 -0600 Subject: [PATCH 14/19] Remove composer-normalize from development dependencies --- composer.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.json b/composer.json index 98d7357..8f5b078 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,6 @@ "phpcfdi/credentials": "^1.3.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.15", "phpunit/phpunit": "^9.5" }, "autoload": { @@ -44,11 +43,6 @@ "PhpCfdi\\CeUtils\\Tests\\": "tests/" } }, - "config": { - "allow-plugins": { - "ergebnis/composer-normalize": true - } - }, "scripts": { "dev:build": [ "@php tools/composer-normalize normalize --dry-run", From 2a0d86d9078103d0f8eb50d5ba3fc4edd8e307d1 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Tue, 17 Mar 2026 15:37:23 -0600 Subject: [PATCH 15/19] Add SonarQube Cloud integration --- .github/workflows/sonarqube-cloud.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/sonarqube-cloud.yml diff --git a/.github/workflows/sonarqube-cloud.yml b/.github/workflows/sonarqube-cloud.yml new file mode 100644 index 0000000..e2f3c05 --- /dev/null +++ b/.github/workflows/sonarqube-cloud.yml @@ -0,0 +1,58 @@ +name: "SonarQube Cloud" +on: + workflow_dispatch: + push: + branches: [ "master" ] + +# Actions +# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action +# SonarSource/sonarqube-scan-action@v7 https://github.com/marketplace/actions/official-sonarqube-scan + +jobs: + + sonarqube-cloud: + name: SonarCloud Scan and Report + runs-on: "ubuntu-latest" + steps: + - name: Check SONAR_TOKEN secret + run: | + if [ -z "$SONAR_TOKEN" ]; then + echo "::warning ::SONAR_TOKEN non set" + exit 1 + fi + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 # Disabling shallow clones is recommended for improving the relevancy of reporting + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + extensions: bcmath + coverage: xdebug + tools: composer:v2 + env: + fail-fast: true + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install project dependencies + run: composer upgrade --no-interaction --no-progress --prefer-dist + - name: Create code coverage + run: vendor/bin/phpunit --testdox --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml + - name: Prepare SonarCloud Code Coverage Files + run: | + 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@v7 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From f2b05f13efc6b6d48a1bc3d5fdb1daa3d2ab4c82 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Wed, 18 Mar 2026 06:09:14 -0600 Subject: [PATCH 16/19] Prepare version 0.3.0 --- README.md | 2 +- docs/CHANGELOG.md | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72edff4..894b8fc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # phpcfdi/ceutils [![Source Code][badge-source]][source] -[![Packagist PHP Version Support][badge-php-version]][php-version] +[![PHP Version][badge-php-version]][php-version] [![Discord][badge-discord]][discord] [![Latest Version][badge-release]][release] [![Software License][badge-license]][license] diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 24f32a7..48d4d70 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,32 @@ aunque sí su incorporación en la rama principal de trabajo. Generalmente, se t ## Listado de cambios +### Versión 0.3.0 2026-03-18 + +Se actualizaron las dependencias del proyecto: + +- `Eclipxe/CfdiUtils` a `^3.0.2`. +- `Eclipxe/XmlResourceRetriever` a `^2.0.3`. +- `Eclipxe/XmlSchemaValidator` a `^3.0.5`. + +Se validó la compatibilidad con PHP 8.4 y PHP 8.5. +Se elimina la compatibilidad con PHP 7.4. + +Se actualizó el año de licencia. + +Cambios en el entorno de desarrollo: + +- Se migra de Scrutinizer-CI a SonarCloud. +- Se actualizan los archivos de configuración de las herramientas de estándar de código. +- Se agrega `composer-normalize` a las herramientas de desarrollo. +- Se actualiza el archivo de integración continua de GitHub: + - Se agrega PHP 8.4 y PHP 8.5 a la matriz de pruebas. + - Se elimina PHP 7.4 de la matriz de pruebas. + - Se actualizan las versiones de las acciones de GitHub. + - Se ejecutan los trabajos en PHP 8.5. + - Se agrega el trabajo `composer-normalize`. +- Se actualizan las herramientas de desarrollo. + ### Versión 0.2.3 2023-12-18 Algunas clases de validadores no estaban marcadas como *finales*. From cf0e1074a76b287a9a87e6fb1e9d0525e749649c Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Wed, 18 Mar 2026 06:10:17 -0600 Subject: [PATCH 17/19] devfix: fix branch name --- .github/workflows/sonarqube-cloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube-cloud.yml b/.github/workflows/sonarqube-cloud.yml index e2f3c05..f38cfbf 100644 --- a/.github/workflows/sonarqube-cloud.yml +++ b/.github/workflows/sonarqube-cloud.yml @@ -2,7 +2,7 @@ name: "SonarQube Cloud" on: workflow_dispatch: push: - branches: [ "master" ] + branches: [ "main" ] # Actions # shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action From da5dc174ca04f1a2ffc77cbf173f711197df0871 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Wed, 18 Mar 2026 06:18:05 -0600 Subject: [PATCH 18/19] Drop support for PHP 8.1 due dependencies phpcfdi/credentials requires php >= 8.1 --- .github/workflows/build.yml | 2 +- .php-cs-fixer.dist.php | 4 ++-- composer.json | 2 +- docs/CHANGELOG.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3a2f77..8dd0ae7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout uses: actions/checkout@v6 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 67692fe..840205d 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,8 +15,8 @@ ->setRules([ '@PSR12' => true, '@PSR12:risky' => true, - '@PHP8x0Migration' => true, - '@PHP8x0Migration:risky' => true, + '@PHP8x1Migration' => true, + '@PHP8x1Migration:risky' => true, // symfony 'class_attributes_separation' => true, 'whitespace_after_comma_in_array' => true, diff --git a/composer.json b/composer.json index 8f5b078..2a55943 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "homepage": "https://github.com/PhpCfdi/CeUtils", "require": { - "php": ">=8.0", + "php": ">=8.1", "ext-bcmath": "*", "ext-dom": "*", "ext-openssl": "*", diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 48d4d70..cc4f606 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -18,7 +18,7 @@ Se actualizaron las dependencias del proyecto: - `Eclipxe/XmlSchemaValidator` a `^3.0.5`. Se validó la compatibilidad con PHP 8.4 y PHP 8.5. -Se elimina la compatibilidad con PHP 7.4. +Se elimina la compatibilidad con PHP 7.4 y PHP 8.0. Se actualizó el año de licencia. @@ -29,7 +29,7 @@ Cambios en el entorno de desarrollo: - Se agrega `composer-normalize` a las herramientas de desarrollo. - Se actualiza el archivo de integración continua de GitHub: - Se agrega PHP 8.4 y PHP 8.5 a la matriz de pruebas. - - Se elimina PHP 7.4 de la matriz de pruebas. + - Se elimina PHP 7.4 y PHP 8.0 de la matriz de pruebas. - Se actualizan las versiones de las acciones de GitHub. - Se ejecutan los trabajos en PHP 8.5. - Se agrega el trabajo `composer-normalize`. From 0a9384869efd8544d3e3b1cfa28201165b17c25a Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Wed, 18 Mar 2026 07:00:03 -0600 Subject: [PATCH 19/19] Improve code using rector/rector and PhpStorm analysis --- docs/CHANGELOG.md | 4 ++++ src/AbstractCreator.php | 5 +++-- src/AuxiliarCuentasCreator13.php | 8 +++---- src/AuxiliarFoliosCreator13.php | 8 +++---- src/BalanzaCreator13.php | 8 +++---- src/CatalogoCreator13.php | 8 +++---- .../AuxiliarCuentas13/AuxiliarCtas.php | 1 + src/Elements/AuxiliarFolios13/DetAuxFol.php | 5 ++++- src/Elements/AuxiliarFolios13/RepAuxFol.php | 1 + src/Elements/Balanza13/Balanza.php | 1 + src/Elements/Catalogo13/Catalogo.php | 1 + src/Elements/Polizas13/Polizas.php | 1 + src/Internal/Amount.php | 6 +++-- src/Internal/PathPropertyTrait.php | 4 ++-- src/PolizasCreator13.php | 8 +++---- src/Validate/Balanza13/CuentasSaldoFinal.php | 2 +- src/Validate/Common/BaseCertificate.php | 5 +---- src/Validate/Common/BaseCurrency.php | 2 +- src/Validate/Common/BaseDifferentRfc.php | 2 +- .../Common/BaseDocumentDefinition.php | 16 +++++--------- .../Common/BaseDocumentFollowSchemas.php | 22 +++++-------------- src/Validate/Common/BaseExchangeRate.php | 2 +- .../Common/BaseUniquePolizaNumber.php | 9 ++++---- src/Validate/MultiValidator.php | 13 ++++------- src/Validate/ValidatorInterface.php | 3 --- .../Unit/Validate/Common/BaseCurrencyTest.php | 2 +- .../Validate/Common/BaseDifferentRfcTest.php | 2 +- .../Validate/Common/BaseExchangeRateTest.php | 2 +- .../Unit/Validate/Common/BaseNumOrdenTest.php | 2 +- .../Validate/Common/BaseNumTramiteTest.php | 2 +- 30 files changed, 66 insertions(+), 89 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cc4f606..e2d7e90 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -22,6 +22,10 @@ Se elimina la compatibilidad con PHP 7.4 y PHP 8.0. Se actualizó el año de licencia. +Se moderniza el código a PHP 8.1 con la ayuda de `rector/rector`. +Este cambio genera múltiples cambios en la definición de propiedades +y la definición de propiedades de tipo solo lectura. + Cambios en el entorno de desarrollo: - Se migra de Scrutinizer-CI a SonarCloud. diff --git a/src/AbstractCreator.php b/src/AbstractCreator.php index 97b8c2a..94c1499 100644 --- a/src/AbstractCreator.php +++ b/src/AbstractCreator.php @@ -13,13 +13,14 @@ use CfdiUtils\XmlResolver\XmlResolverPropertyTrait; use PhpCfdi\CeUtils\Validate\MultiValidator; use PhpCfdi\Credentials\Credential; +use RuntimeException; abstract class AbstractCreator { use XsltBuilderPropertyTrait; use XmlResolverPropertyTrait; - public function __construct(?XmlResolver $xmlResolver = null) + public function __construct(XmlResolver|null $xmlResolver = null) { $this->setXsltBuilder(new DOMBuilder()); $this->setXmlResolver($xmlResolver ?? new XmlResolver()); @@ -60,7 +61,7 @@ public function buildCadenaDeOrigen(): string $location = $this->getXmlResolver()->resolve($this->getXsltLocation(), 'XSLT'); $sourceString = $this->getXsltBuilder()->build($this->asXml(), $location); if ('' === trim($sourceString, '|')) { - throw new \RuntimeException('Unable to create the source string'); + throw new RuntimeException('Unable to create the source string'); } return $sourceString; } diff --git a/src/AuxiliarCuentasCreator13.php b/src/AuxiliarCuentasCreator13.php index c886787..5e44416 100644 --- a/src/AuxiliarCuentasCreator13.php +++ b/src/AuxiliarCuentasCreator13.php @@ -12,12 +12,10 @@ class AuxiliarCuentasCreator13 extends AbstractCreator { - private AuxiliarCtas $auxiliarCuentas; + private readonly AuxiliarCtas $auxiliarCuentas; - /** - * @param array $attributes - */ - public function __construct(array $attributes) + /** @param array $attributes */ + public function __construct(array $attributes = []) { parent::__construct(); $this->auxiliarCuentas = new AuxiliarCtas($attributes); diff --git a/src/AuxiliarFoliosCreator13.php b/src/AuxiliarFoliosCreator13.php index ed0192a..3dd44db 100644 --- a/src/AuxiliarFoliosCreator13.php +++ b/src/AuxiliarFoliosCreator13.php @@ -12,12 +12,10 @@ class AuxiliarFoliosCreator13 extends AbstractCreator { - private RepAuxFol $repAuxFol; + private readonly RepAuxFol $repAuxFol; - /** - * @param array $attributes - */ - public function __construct(array $attributes) + /** @param array $attributes */ + public function __construct(array $attributes = []) { parent::__construct(); $this->repAuxFol = new RepAuxFol($attributes); diff --git a/src/BalanzaCreator13.php b/src/BalanzaCreator13.php index a34f200..ca195de 100644 --- a/src/BalanzaCreator13.php +++ b/src/BalanzaCreator13.php @@ -12,12 +12,10 @@ class BalanzaCreator13 extends AbstractCreator { - private Balanza $balanza; + private readonly Balanza $balanza; - /** - * @param array $attributes - */ - public function __construct(array $attributes) + /** @param array $attributes */ + public function __construct(array $attributes = []) { parent::__construct(); $this->balanza = new Balanza($attributes); diff --git a/src/CatalogoCreator13.php b/src/CatalogoCreator13.php index 396fb75..cce0b43 100644 --- a/src/CatalogoCreator13.php +++ b/src/CatalogoCreator13.php @@ -12,12 +12,10 @@ class CatalogoCreator13 extends AbstractCreator { - private Catalogo $catalogo; + private readonly Catalogo $catalogo; - /** - * @param array $attributes - */ - public function __construct(array $attributes) + /** @param array $attributes */ + public function __construct(array $attributes = []) { parent::__construct(); $this->catalogo = new Catalogo($attributes); diff --git a/src/Elements/AuxiliarCuentas13/AuxiliarCtas.php b/src/Elements/AuxiliarCuentas13/AuxiliarCtas.php index 80440cf..8549c9c 100644 --- a/src/Elements/AuxiliarCuentas13/AuxiliarCtas.php +++ b/src/Elements/AuxiliarCuentas13/AuxiliarCtas.php @@ -14,6 +14,7 @@ public function getElementName(): string return AuxiliarCuentas13Definition::ELEMENT_NAME; } + /** @noinspection PhpMissingParentCallCommonInspection */ public function getFixedAttributes(): array { return [ diff --git a/src/Elements/AuxiliarFolios13/DetAuxFol.php b/src/Elements/AuxiliarFolios13/DetAuxFol.php index 348be79..e7a305e 100644 --- a/src/Elements/AuxiliarFolios13/DetAuxFol.php +++ b/src/Elements/AuxiliarFolios13/DetAuxFol.php @@ -13,7 +13,10 @@ public function getElementName(): string return 'RepAux:DetAuxFol'; } - /** @return string[] */ + /** + * @noinspection PhpMissingParentCallCommonInspection + * @return string[] + */ public function getChildrenOrder(): array { return [ diff --git a/src/Elements/AuxiliarFolios13/RepAuxFol.php b/src/Elements/AuxiliarFolios13/RepAuxFol.php index 62bfba5..40fecb9 100644 --- a/src/Elements/AuxiliarFolios13/RepAuxFol.php +++ b/src/Elements/AuxiliarFolios13/RepAuxFol.php @@ -14,6 +14,7 @@ public function getElementName(): string return AuxiliarFolios13Definition::ELEMENT_NAME; } + /** @noinspection PhpMissingParentCallCommonInspection */ public function getFixedAttributes(): array { return [ diff --git a/src/Elements/Balanza13/Balanza.php b/src/Elements/Balanza13/Balanza.php index e3d04ee..261f06f 100644 --- a/src/Elements/Balanza13/Balanza.php +++ b/src/Elements/Balanza13/Balanza.php @@ -14,6 +14,7 @@ public function getElementName(): string return Balanza13Definition::ELEMENT_NAME; } + /** @noinspection PhpMissingParentCallCommonInspection */ public function getFixedAttributes(): array { return [ diff --git a/src/Elements/Catalogo13/Catalogo.php b/src/Elements/Catalogo13/Catalogo.php index 089f5f4..a8dc340 100644 --- a/src/Elements/Catalogo13/Catalogo.php +++ b/src/Elements/Catalogo13/Catalogo.php @@ -14,6 +14,7 @@ public function getElementName(): string return Catalogo13Definition::ELEMENT_NAME; } + /** @noinspection PhpMissingParentCallCommonInspection */ public function getFixedAttributes(): array { return [ diff --git a/src/Elements/Polizas13/Polizas.php b/src/Elements/Polizas13/Polizas.php index ac035ce..b7ba5d3 100644 --- a/src/Elements/Polizas13/Polizas.php +++ b/src/Elements/Polizas13/Polizas.php @@ -14,6 +14,7 @@ public function getElementName(): string return Polizas13Definition::ELEMENT_NAME; } + /** @noinspection PhpMissingParentCallCommonInspection */ public function getFixedAttributes(): array { return [ diff --git a/src/Internal/Amount.php b/src/Internal/Amount.php index 79f25b0..d05b705 100644 --- a/src/Internal/Amount.php +++ b/src/Internal/Amount.php @@ -4,12 +4,14 @@ namespace PhpCfdi\CeUtils\Internal; +use Stringable; + /** * Clase para hacer operaciones con tipos t_Importe * * @internal */ -final class Amount +final class Amount implements Stringable { public const MIN_VALUE = '-9999999999999999999999.99'; @@ -17,7 +19,7 @@ final class Amount private const SCALE = 2; - private string $value; + private readonly string $value; public function __construct(string $value) { diff --git a/src/Internal/PathPropertyTrait.php b/src/Internal/PathPropertyTrait.php index a7e5026..1af96b5 100644 --- a/src/Internal/PathPropertyTrait.php +++ b/src/Internal/PathPropertyTrait.php @@ -6,10 +6,10 @@ trait PathPropertyTrait { - /** @var string[] */ + /** @var list */ private array $path; - /** @return string[] */ + /** @return list */ public function getPath(): array { return $this->path; diff --git a/src/PolizasCreator13.php b/src/PolizasCreator13.php index 19b020d..81c7da6 100644 --- a/src/PolizasCreator13.php +++ b/src/PolizasCreator13.php @@ -12,12 +12,10 @@ class PolizasCreator13 extends AbstractCreator { - private Polizas $polizas; + private readonly Polizas $polizas; - /** - * @param array $attributes - */ - public function __construct(array $attributes) + /** @param array $attributes */ + public function __construct(array $attributes = []) { parent::__construct(); $this->polizas = new Polizas($attributes); diff --git a/src/Validate/Balanza13/CuentasSaldoFinal.php b/src/Validate/Balanza13/CuentasSaldoFinal.php index 6b8e56d..e500263 100644 --- a/src/Validate/Balanza13/CuentasSaldoFinal.php +++ b/src/Validate/Balanza13/CuentasSaldoFinal.php @@ -63,7 +63,7 @@ public function validateNodeCtas(int $index, NodeInterface $node, Asserts $asser $node['Debe'], $node['Haber'], $node['SaldoFin'], - (string) $equals, + $equals ? 'Verdadero' : 'Falso', ), ); return $equals; diff --git a/src/Validate/Common/BaseCertificate.php b/src/Validate/Common/BaseCertificate.php index 44caf5f..1f51166 100644 --- a/src/Validate/Common/BaseCertificate.php +++ b/src/Validate/Common/BaseCertificate.php @@ -29,12 +29,9 @@ abstract class BaseCertificate implements use XmlResolverPropertyTrait; use XsltBuilderPropertyTrait; - private string $xsltLocation; - - public function __construct(string $assertPrefix, string $xsltLocation) + public function __construct(string $assertPrefix, private readonly string $xsltLocation) { $this->assertPrefix = $assertPrefix; - $this->xsltLocation = $xsltLocation; } public function getXsltLocation(): string diff --git a/src/Validate/Common/BaseCurrency.php b/src/Validate/Common/BaseCurrency.php index a2495be..f9f1ccc 100644 --- a/src/Validate/Common/BaseCurrency.php +++ b/src/Validate/Common/BaseCurrency.php @@ -21,7 +21,7 @@ abstract class BaseCurrency implements ValidatorInterface public function __construct(string $assertPrefix, string ...$path) { $this->assertPrefix = $assertPrefix; - $this->path = $path; + $this->path = array_values($path); } public function validate(NodeInterface $root, Asserts $asserts): void diff --git a/src/Validate/Common/BaseDifferentRfc.php b/src/Validate/Common/BaseDifferentRfc.php index ddcd81c..7c714c8 100644 --- a/src/Validate/Common/BaseDifferentRfc.php +++ b/src/Validate/Common/BaseDifferentRfc.php @@ -21,7 +21,7 @@ abstract class BaseDifferentRfc implements ValidatorInterface public function __construct(string $assertPrefix, string ...$path) { $this->assertPrefix = $assertPrefix; - $this->path = $path; + $this->path = array_values($path); } public function validate(NodeInterface $root, Asserts $asserts): void diff --git a/src/Validate/Common/BaseDocumentDefinition.php b/src/Validate/Common/BaseDocumentDefinition.php index e578dbb..3a6d2b2 100644 --- a/src/Validate/Common/BaseDocumentDefinition.php +++ b/src/Validate/Common/BaseDocumentDefinition.php @@ -11,17 +11,11 @@ abstract class BaseDocumentDefinition implements ValidatorInterface { - private string $assertPrefix; - - private string $rootElementName; - - private string $namespace; - - public function __construct(string $assertPrefix, string $rootElementName, string $namespace) - { - $this->assertPrefix = $assertPrefix; - $this->rootElementName = $rootElementName; - $this->namespace = $namespace; + public function __construct( + private readonly string $assertPrefix, + private readonly string $rootElementName, + private readonly string $namespace, + ) { } public function getAssertName(string $suffix): string diff --git a/src/Validate/Common/BaseDocumentFollowSchemas.php b/src/Validate/Common/BaseDocumentFollowSchemas.php index 60c9eba..4d61459 100644 --- a/src/Validate/Common/BaseDocumentFollowSchemas.php +++ b/src/Validate/Common/BaseDocumentFollowSchemas.php @@ -28,17 +28,11 @@ abstract class BaseDocumentFollowSchemas implements use XmlStringPropertyTrait; use XmlResolverPropertyTrait; - private string $assertPrefix; - - private string $namespace; - - private string $xsdLocation; - - public function __construct(string $assertPrefix, string $namespace, string $xsdLocation) - { - $this->assertPrefix = $assertPrefix; - $this->namespace = $namespace; - $this->xsdLocation = $xsdLocation; + public function __construct( + private readonly string $assertPrefix, + private readonly string $namespace, + private readonly string $xsdLocation, + ) { } public function getAssertName(string $suffix): string @@ -106,11 +100,7 @@ public function validateLocation(Schemas $schemas, Assert $locationAssert): bool return $locationMatches; } - /** - * @param SchemaValidator $schemaValidator - * @param Schemas $schemas - * @return string[] XSD detected errors - */ + /** @return string[] XSD detected errors */ public function validateXsdSchemas(SchemaValidator $schemaValidator, Schemas $schemas): array { $resolver = $this->xmlResolver; diff --git a/src/Validate/Common/BaseExchangeRate.php b/src/Validate/Common/BaseExchangeRate.php index 6720c75..7a07531 100644 --- a/src/Validate/Common/BaseExchangeRate.php +++ b/src/Validate/Common/BaseExchangeRate.php @@ -21,7 +21,7 @@ abstract class BaseExchangeRate implements ValidatorInterface public function __construct(string $assertPrefix, string ...$path) { $this->assertPrefix = $assertPrefix; - $this->path = $path; + $this->path = array_values($path); } public function validate(NodeInterface $root, Asserts $asserts): void diff --git a/src/Validate/Common/BaseUniquePolizaNumber.php b/src/Validate/Common/BaseUniquePolizaNumber.php index 647995c..24e268e 100644 --- a/src/Validate/Common/BaseUniquePolizaNumber.php +++ b/src/Validate/Common/BaseUniquePolizaNumber.php @@ -16,12 +16,11 @@ abstract class BaseUniquePolizaNumber implements ValidatorInterface { use AssertPrefixPropertyTrait; - private string $childName; - - public function __construct(string $assertPrefix, string $childName) - { + public function __construct( + string $assertPrefix, + private readonly string $childName, + ) { $this->assertPrefix = $assertPrefix; - $this->childName = $childName; } public function getChildName(): string diff --git a/src/Validate/MultiValidator.php b/src/Validate/MultiValidator.php index b7569c8..507bed1 100644 --- a/src/Validate/MultiValidator.php +++ b/src/Validate/MultiValidator.php @@ -14,16 +14,14 @@ abstract class MultiValidator /** @var array */ protected array $validatorClasses = []; - private Hydrater $hydrater; + private readonly Hydrater $hydrater; public function __construct() { $this->hydrater = new Hydrater(); } - /** - * @return array - */ + /** @return array */ public function getValidatorClasses(): array { return $this->validatorClasses; @@ -46,9 +44,7 @@ public function validate(NodeInterface $root): Asserts return $asserts; } - /** - * @return Generator - */ + /** @return Generator */ protected function createValidators(): Generator { foreach ($this->getValidatorClasses() as $validatorClass) { @@ -57,10 +53,9 @@ protected function createValidators(): Generator } /** - * Creates an hydrated validator + * Creates a hydrated validator * * @param class-string $validatorClass - * @return ValidatorInterface */ protected function createValidator(string $validatorClass): ValidatorInterface { diff --git a/src/Validate/ValidatorInterface.php b/src/Validate/ValidatorInterface.php index 7f98335..2e2abdd 100644 --- a/src/Validate/ValidatorInterface.php +++ b/src/Validate/ValidatorInterface.php @@ -19,9 +19,6 @@ public static function create(); /** * Run validations populating the asserts collection - * - * @param NodeInterface $root - * @param Asserts $asserts */ public function validate(NodeInterface $root, Asserts $asserts): void; } diff --git a/tests/Unit/Validate/Common/BaseCurrencyTest.php b/tests/Unit/Validate/Common/BaseCurrencyTest.php index 5546d77..cbe4724 100644 --- a/tests/Unit/Validate/Common/BaseCurrencyTest.php +++ b/tests/Unit/Validate/Common/BaseCurrencyTest.php @@ -19,7 +19,7 @@ protected function setUp(): void parent::setUp(); $this->validator = new class ('FOO', ...['a:foo', 'a:bar']) extends BaseCurrency { - public static function create(): void + public static function create(): never { throw new LogicException("Static method won't be tested"); } diff --git a/tests/Unit/Validate/Common/BaseDifferentRfcTest.php b/tests/Unit/Validate/Common/BaseDifferentRfcTest.php index cf326e1..53acf35 100644 --- a/tests/Unit/Validate/Common/BaseDifferentRfcTest.php +++ b/tests/Unit/Validate/Common/BaseDifferentRfcTest.php @@ -19,7 +19,7 @@ protected function setUp(): void parent::setUp(); $this->validator = new class ('FOO', ...['a:foo', 'a:bar']) extends BaseDifferentRfc { - public static function create(): void + public static function create(): never { throw new LogicException("Static method won't be tested"); } diff --git a/tests/Unit/Validate/Common/BaseExchangeRateTest.php b/tests/Unit/Validate/Common/BaseExchangeRateTest.php index a982f48..ff58af7 100644 --- a/tests/Unit/Validate/Common/BaseExchangeRateTest.php +++ b/tests/Unit/Validate/Common/BaseExchangeRateTest.php @@ -19,7 +19,7 @@ protected function setUp(): void parent::setUp(); $this->validator = new class ('FOO', ...['a:foo', 'a:bar']) extends BaseExchangeRate { - public static function create(): void + public static function create(): never { throw new LogicException('Static method wont be tested'); } diff --git a/tests/Unit/Validate/Common/BaseNumOrdenTest.php b/tests/Unit/Validate/Common/BaseNumOrdenTest.php index 14a2d38..af5e240 100644 --- a/tests/Unit/Validate/Common/BaseNumOrdenTest.php +++ b/tests/Unit/Validate/Common/BaseNumOrdenTest.php @@ -18,7 +18,7 @@ protected function setUp(): void { parent::setUp(); $this->validator = new class ('PREFIX') extends BaseNumOrden { - public static function create(): void + public static function create(): never { throw new LogicException("Static method won't be tested"); } diff --git a/tests/Unit/Validate/Common/BaseNumTramiteTest.php b/tests/Unit/Validate/Common/BaseNumTramiteTest.php index 3237189..22d7cb4 100644 --- a/tests/Unit/Validate/Common/BaseNumTramiteTest.php +++ b/tests/Unit/Validate/Common/BaseNumTramiteTest.php @@ -18,7 +18,7 @@ protected function setUp(): void { parent::setUp(); $this->validator = new class ('PREFIX') extends BaseNumTramite { - public static function create(): void + public static function create(): never { throw new LogicException("Static method won't be tested"); }