Skip to content

Commit dbef009

Browse files
authored
Merge pull request #88 from eclipxe13/version-5.0.0
Cambios en compatibilidad de PHP 8.2 - 8.4 (Versión 5.0.0)
2 parents e53f120 + 7aab058 commit dbef009

83 files changed

Lines changed: 415 additions & 848 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,56 @@ on:
1313

1414
jobs:
1515

16-
phpcs:
17-
name: Code style (phpcs)
16+
composer-normalize:
17+
name: Composer normalization
1818
runs-on: "ubuntu-latest"
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v4
2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2
2424
with:
25-
php-version: '8.3'
25+
php-version: '8.4'
2626
coverage: none
27-
tools: cs2pr, phpcs
27+
tools: composer-normalize
2828
env:
2929
fail-fast: true
30-
- name: Code style (phpcs)
31-
run: phpcs -q --report=checkstyle | cs2pr
30+
- name: Composer normalize
31+
run: composer-normalize
3232

33-
php-cs-fixer:
34-
name: Code style (php-cs-fixer)
33+
phpcs:
34+
name: Code style (phpcs)
3535
runs-on: "ubuntu-latest"
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v4
3939
- name: Setup PHP
4040
uses: shivammathur/setup-php@v2
4141
with:
42-
php-version: '8.3'
42+
php-version: '8.4'
4343
coverage: none
44-
tools: cs2pr, php-cs-fixer
44+
tools: cs2pr, phpcs
4545
env:
4646
fail-fast: true
47-
- name: Code style (php-cs-fixer)
48-
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
47+
- name: Code style (phpcs)
48+
run: phpcs -q --report=checkstyle | cs2pr
4949

50-
composer-normalize:
51-
name: Composer normalization
50+
php-cs-fixer:
51+
name: Code style (php-cs-fixer)
5252
runs-on: "ubuntu-latest"
5353
steps:
5454
- name: Checkout
5555
uses: actions/checkout@v4
5656
- name: Setup PHP
5757
uses: shivammathur/setup-php@v2
5858
with:
59-
php-version: '8.3'
59+
php-version: '8.4'
6060
coverage: none
61-
tools: composer-normalize
61+
tools: cs2pr, php-cs-fixer
6262
env:
6363
fail-fast: true
64-
- name: Composer normalize
65-
run: composer-normalize
64+
- name: Code style (php-cs-fixer)
65+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
6666

6767
phpstan:
6868
name: Code analysis (phpstan)
@@ -73,7 +73,7 @@ jobs:
7373
- name: Setup PHP
7474
uses: shivammathur/setup-php@v2
7575
with:
76-
php-version: '8.3'
76+
php-version: '8.4'
7777
coverage: none
7878
tools: composer:v2, phpstan
7979
env:
@@ -97,7 +97,7 @@ jobs:
9797
runs-on: "ubuntu-latest"
9898
strategy:
9999
matrix:
100-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
100+
php-version: ['8.2', '8.3', '8.4']
101101
steps:
102102
- name: Checkout
103103
uses: actions/checkout@v4
@@ -118,10 +118,7 @@ jobs:
118118
path: ${{ steps.composer-cache.outputs.dir }}
119119
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
120120
restore-keys: ${{ runner.os }}-composer-
121-
- name: Remove phpcfdi/image-captcha-resolver-boxfactura-ai for PHP < 8.1
122-
if: ${{ matrix.php-version < '8.1' }}
123-
run: composer remove phpcfdi/image-captcha-resolver-boxfactura-ai --dev --no-interaction --no-progress --no-update
124121
- name: Install project dependencies
125122
run: composer upgrade --no-interaction --no-progress --prefer-dist
126123
- name: Tests (phpunit)
127-
run: vendor/bin/phpunit --testdox --verbose
124+
run: vendor/bin/phpunit --testdox

.github/workflows/coverage.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "SonarQube Cloud"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [ "main" ]
6+
7+
# Actions
8+
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action
9+
# SonarSource/sonarqube-scan-action@v5 https://github.com/marketplace/actions/official-sonarqube-scan
10+
11+
jobs:
12+
13+
sonarqube-cloud:
14+
name: SonarCloud Scan and Report
15+
runs-on: "ubuntu-latest"
16+
steps:
17+
- name: Check SONAR_TOKEN secret
18+
run: |
19+
if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then
20+
echo "::warning ::SONAR_TOKEN non set"
21+
exit 1
22+
fi
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
- name: Unshallow clone to provide blame information
26+
run: git fetch --unshallow
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '8.4'
31+
coverage: xdebug
32+
tools: composer:v2
33+
- name: Get composer cache directory
34+
id: composer-cache
35+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36+
- name: Cache dependencies
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ steps.composer-cache.outputs.dir }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: ${{ runner.os }}-composer-
42+
- name: Install project dependencies
43+
run: composer upgrade --no-interaction --no-progress --prefer-dist
44+
- name: Create code coverage
45+
run: vendor/bin/phpunit --testdox --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
46+
- name: Prepare SonarCloud Code Coverage Files
47+
run: |
48+
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/junit.xml > build/sonar-junit.xml
49+
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/clover.xml > build/sonar-coverage.xml
50+
- name: SonarCloud Scan
51+
uses: SonarSource/sonarqube-scan-action@v5
52+
env:
53+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.phive/phars.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.75.0" installed="3.75.0" location="./tools/php-cs-fixer" copy="false"/>
4-
<phar name="phpcs" version="^3.13.0" installed="3.13.0" location="./tools/phpcs" copy="false"/>
5-
<phar name="phpcbf" version="^3.13.0" installed="3.13.0" location="./tools/phpcbf" copy="false"/>
6-
<phar name="phpstan" version="^2.1.17" installed="2.1.17" location="./tools/phpstan" copy="false"/>
7-
<phar name="composer-normalize" version="^2.47.0" installed="2.47.0" location="./tools/composer-normalize" copy="false"/>
3+
<phar name="php-cs-fixer" version="^3.87.2" installed="3.87.2" location="./tools/php-cs-fixer" copy="false"/>
4+
<phar name="phpcs" version="^3.13.4" installed="3.13.4" location="./tools/phpcs" copy="false"/>
5+
<phar name="phpcbf" version="^3.13.4" installed="3.13.4" location="./tools/phpcbf" copy="false"/>
6+
<phar name="phpstan" version="^2.1.25" installed="2.1.25" location="./tools/phpstan" copy="false"/>
7+
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
88
</phive>

.php-cs-fixer.dist.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
->setRules([
1616
'@PSR12' => true,
1717
'@PSR12:risky' => true,
18-
'@PHP71Migration:risky' => true,
19-
'@PHP73Migration' => true,
18+
'@PHP82Migration:risky' => true,
19+
'@PHP82Migration' => true,
2020
// symfony
2121
'class_attributes_separation' => true,
2222
'whitespace_after_comma_in_array' => true,
2323
'no_empty_statement' => true,
2424
'no_extra_blank_lines' => true,
2525
'type_declaration_spaces' => true,
26-
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'arguments']],
26+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'match', 'arguments', 'parameters']],
2727
'no_blank_lines_after_phpdoc' => true,
2828
'object_operator_without_whitespace' => true,
2929
'binary_operator_spaces' => true,
@@ -36,6 +36,7 @@
3636
'standardize_not_equals' => true,
3737
'concat_space' => ['spacing' => 'one'],
3838
'linebreak_after_opening_tag' => true,
39+
'fully_qualified_strict_types' => true,
3940
// symfony:risky
4041
'no_alias_functions' => true,
4142
'self_accessor' => true,

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ Consulta las guías de actualización:
579579

580580
- [Actualización de la versión `2.x` a la versión `3.x`](docs/UPGRADE-2-3.md).
581581
- [Actualización de la versión `3.x` a la versión `4.x`](docs/UPGRADE-3-4.md).
582+
- [Actualización de la versión `4.x` a la versión `5.x`](docs/UPGRADE-4-5.md).
582583

583584
## Contribuciones
584585

@@ -620,6 +621,6 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
620621
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/cfdi-sat-scraper/build.yml?branch=main&logo=github-actions
621622
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_cfdi-sat-scraper&metric=reliability_rating
622623
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_cfdi-sat-scraper&metric=sqale_rating
623-
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_cfdi-sat-scraper/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
624-
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_cfdi-sat-scraper/main?format=long&logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
624+
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_cfdi-sat-scraper/main?logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
625+
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_cfdi-sat-scraper/main?format=long&logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
625626
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/cfdi-sat-scraper?logo=packagist

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=7.3",
23+
"php": ">=8.2",
2424
"ext-curl": "*",
2525
"ext-dom": "*",
2626
"ext-fileinfo": "*",
@@ -32,16 +32,16 @@
3232
"guzzlehttp/guzzle": "^7.0",
3333
"guzzlehttp/promises": "^2.0",
3434
"phpcfdi/credentials": "^1.1",
35-
"phpcfdi/image-captcha-resolver": "^0.2.4",
35+
"phpcfdi/image-captcha-resolver": "^0.3.0",
3636
"psr/http-message": "^1.1 || ^2.0",
3737
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
3838
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0"
3939
},
4040
"require-dev": {
4141
"ext-iconv": "*",
4242
"fakerphp/faker": "^1.13",
43-
"phpcfdi/image-captcha-resolver-boxfactura-ai": "^0.1.0",
44-
"phpunit/phpunit": "^9.5",
43+
"phpcfdi/image-captcha-resolver-boxfactura-ai": "^0.2.0",
44+
"phpunit/phpunit": "^11.5",
4545
"symfony/dotenv": "^5.4 || ^6.0 || ^7.0"
4646
},
4747
"autoload": {
@@ -72,17 +72,17 @@
7272
],
7373
"dev:check-style": [
7474
"@php tools/composer-normalize normalize --dry-run",
75-
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --dry-run --verbose",
75+
"@php tools/php-cs-fixer fix --dry-run --verbose",
7676
"@php tools/phpcs --colors -sp"
7777
],
7878
"dev:fix-style": [
7979
"@php tools/composer-normalize normalize",
80-
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --verbose",
80+
"@php tools/php-cs-fixer fix --verbose",
8181
"@php tools/phpcbf --colors -sp"
8282
],
8383
"dev:tests": [
8484
"@dev:check-style",
85-
"@php vendor/bin/phpunit --testdox --verbose",
85+
"@php vendor/bin/phpunit --testdox",
8686
"@php tools/phpstan analyze --no-progress --verbose"
8787
]
8888
},

0 commit comments

Comments
 (0)