Skip to content

Commit 7a4912d

Browse files
authored
Merge pull request #8 from eclipxe13/maintenance
Compatibilidad y mantenimiento (Versión 0.3.0)
2 parents 585dfde + c91c320 commit 7a4912d

44 files changed

Lines changed: 280 additions & 429 deletions

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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
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
2727
tools: composer-normalize
2828
env:
@@ -39,7 +39,7 @@ jobs:
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
4444
tools: cs2pr, phpcs
4545
env:
@@ -56,7 +56,7 @@ jobs:
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
6161
tools: cs2pr, php-cs-fixer
6262
env:
@@ -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, cs2pr, 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
@@ -121,4 +121,4 @@ jobs:
121121
- name: Install project dependencies
122122
run: composer upgrade --no-interaction --no-progress --prefer-dist
123123
- name: Tests (phpunit)
124-
run: vendor/bin/phpunit --testdox --verbose
124+
run: vendor/bin/phpunit --testdox

.github/workflows/sonarcloud.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="phpcs" version="^3.10.3" installed="3.10.3" location="./tools/phpcs" copy="false"/>
4-
<phar name="phpcbf" version="^3.10.3" installed="3.10.3" location="./tools/phpcbf" copy="false"/>
5-
<phar name="php-cs-fixer" version="^3.64.0" installed="3.64.0" location="./tools/php-cs-fixer" copy="false"/>
6-
<phar name="phpstan" version="^1.12.5" installed="1.12.5" location="./tools/phpstan" copy="false"/>
7-
<phar name="composer-normalize" version="^2.44.0" installed="2.44.0" location="./tools/composer-normalize" copy="false"/>
3+
<phar name="phpcs" version="^3.13.4" installed="3.13.4" location="./tools/phpcs" copy="false"/>
4+
<phar name="phpcbf" version="^3.13.4" installed="3.13.4" location="./tools/phpcbf" copy="false"/>
5+
<phar name="php-cs-fixer" version="^3.87.2" installed="3.87.2" location="./tools/php-cs-fixer" 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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +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', 'match', 'arguments', 'parameters']],
2627
'no_blank_lines_after_phpdoc' => true,
2728
'object_operator_without_whitespace' => true,
2829
'binary_operator_spaces' => true,
@@ -35,16 +36,18 @@
3536
'standardize_not_equals' => true,
3637
'concat_space' => ['spacing' => 'one'],
3738
'linebreak_after_opening_tag' => true,
39+
'fully_qualified_strict_types' => true,
3840
// symfony:risky
3941
'no_alias_functions' => true,
4042
'self_accessor' => true,
4143
// contrib
4244
'not_operator_with_successor_space' => true,
45+
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], // @PSR12 sort_algorithm: none
4346
])
4447
->setFinder(
4548
PhpCsFixer\Finder::create()
4649
->in(__DIR__)
4750
->append([__FILE__])
48-
->exclude(['vendor', 'tools', 'build'])
51+
->exclude(['vendor', 'tools', 'build']),
4952
)
5053
;

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 - 2024 PhpCfdi https://www.phpcfdi.com/
3+
Copyright (c) 2021 - 2025 PhpCfdi https://www.phpcfdi.com/
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,6 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
321321
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/image-captcha-resolver/build.yml?branch=main&logo=github-actions
322322
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_image-captcha-resolver&metric=reliability_rating
323323
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_image-captcha-resolver&metric=sqale_rating
324-
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_image-captcha-resolver/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
325-
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_image-captcha-resolver/main?format=long&logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
324+
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_image-captcha-resolver/main?logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
325+
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_image-captcha-resolver/main?format=long&logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
326326
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/image-captcha-resolver?logo=packagist

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "phpcfdi/image-captcha-resolver",
33
"description": "Conectores para resolver captchas de imágenes",
44
"license": "MIT",
5-
"keywords": [],
65
"authors": [
76
{
87
"name": "Carlos C Soto",
@@ -16,7 +15,7 @@
1615
"source": "https://github.com/phpcfdi/image-captcha-resolver"
1716
},
1817
"require": {
19-
"php": ">=7.3",
18+
"php": ">=8.2",
2019
"ext-fileinfo": "*",
2120
"ext-json": "*",
2221
"php-http/discovery": "^1.14",
@@ -30,8 +29,8 @@
3029
"guzzlehttp/psr7": "^2.0",
3130
"php-http/guzzle7-adapter": "^1.0",
3231
"php-http/mock-client": "^1.4",
33-
"phpunit/phpunit": "^9.5",
34-
"symfony/process": "^5.4 || ^6.4 || ^7.1",
32+
"phpunit/phpunit": "^11.5",
33+
"symfony/process": "^6.4 || ^7.1",
3534
"vlucas/phpdotenv": "^5.3"
3635
},
3736
"suggest": {
@@ -63,21 +62,21 @@
6362
"@dev:test"
6463
],
6564
"dev:check-style": [
66-
"@php -r 'exit(intval(PHP_VERSION_ID >= 80000));' || $PHP_BINARY tools/composer-normalize normalize --dry-run",
67-
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --dry-run --verbose || true",
65+
"@php tools/composer-normalize normalize --dry-run",
66+
"@php tools/php-cs-fixer fix --dry-run --verbose || true",
6867
"@php tools/phpcs --colors -sp"
6968
],
7069
"dev:coverage": [
71-
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/"
70+
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --coverage-html build/coverage/html/"
7271
],
7372
"dev:fix-style": [
74-
"@php -r 'exit(intval(PHP_VERSION_ID >= 80000));' || $PHP_BINARY tools/composer-normalize normalize",
75-
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --verbose",
73+
"@php tools/composer-normalize normalize",
74+
"@php tools/php-cs-fixer fix --verbose",
7675
"@php tools/phpcbf --colors -sp"
7776
],
7877
"dev:test": [
7978
"@dev:check-style",
80-
"@php vendor/bin/phpunit --testdox --verbose --stop-on-failure",
79+
"@php vendor/bin/phpunit --testdox --stop-on-failure",
8180
"@php tools/phpstan analyse --no-progress --verbose"
8281
]
8382
},

docs/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr
55
Pueden aparecer cambios no liberados que se integran a la rama principal, pero no ameritan una nueva liberación de
66
versión, aunque sí su incorporación en la rama principal de trabajo. Generalmente, se tratan de cambios en el desarrollo.
77

8+
## Versión 0.3.0 2025-09-13
9+
10+
- Se revisa la compatibilidad de PHP 8.4.
11+
- Se cambian las definiciones implícitas a tipos *nullables* a explícitas.
12+
- Se actualizó el año de la licencia.
13+
- Se hacen diversos cambios para asegurar los tipos de datos y satisfacer PHPStan.
14+
15+
Cambios de mantenimiento al entorno de desarrollo:
16+
17+
- Se normalizó `composer.json`.
18+
- Se actualiza a PHPUnit 11.5.
19+
- Se actualizan las reglas para `php-cs-fixer` y `phpcs`.
20+
- En los flujos de trabajo de GitHub:
21+
- Se agrega PHP 8.4 a la matrix de pruebas.
22+
- Los trabajos se ejecutan en PHP 8.4.
23+
- Se actualiza la integración con SonarQube Cloud.
24+
- Se actualizaron las herramientas de desarrollo.
25+
826
## Versión 0.2.4 2024-10-03
927

1028
- Se agrega la compatibilidad de `symfony/process` a las versiones `6.x` y `7.x`.

phpcs.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
1919
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
2020
<rule ref="Generic.Formatting.SpaceAfterNot"/>
21-
<rule ref="Generic.Functions.CallTimePassByReference"/>
2221
<rule ref="Generic.NamingConventions.ConstructorName"/>
2322
<rule ref="Generic.PHP.DeprecatedFunctions"/>
2423
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>

0 commit comments

Comments
 (0)