Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36ce35d
Update license year
eclipxe13 Sep 12, 2025
532ad1d
Add check type for finfo
eclipxe13 Sep 12, 2025
c11aa7b
Convert implicit nullable types to explicit
eclipxe13 Sep 12, 2025
e924e0c
Better check for converting code & answer values
eclipxe13 Sep 12, 2025
22572bf
Improve types for PHPStan
eclipxe13 Sep 12, 2025
d4af632
Improve types for PHPStan (anti-captcha)
eclipxe13 Sep 12, 2025
9fd08ef
Update development tools
eclipxe13 Sep 12, 2025
8d0c58c
Composer normalization
eclipxe13 Sep 12, 2025
c059d58
Remove deprecated rule
eclipxe13 Sep 12, 2025
dfc3717
Add PHP 8.4 to test matrix
eclipxe13 Sep 12, 2025
4bdf843
Run jobs using PHP 8.4
eclipxe13 Sep 12, 2025
2f6bd18
Update SonarQube Cloud integration
eclipxe13 Sep 12, 2025
8fdcd5b
Update code standard rules
eclipxe13 Sep 12, 2025
d155c80
Prepare version 0.2.5
eclipxe13 Sep 12, 2025
d88ceb5
Fix badges logo for SonarQube Cloud
eclipxe13 Sep 12, 2025
2d03408
Bump minimal PHP version to 7.4
eclipxe13 Sep 12, 2025
731fc41
Type declarations
eclipxe13 Sep 12, 2025
d6a8e0c
Dead code
eclipxe13 Sep 12, 2025
c27ab58
Code quality
eclipxe13 Sep 12, 2025
b428599
Bump minimal PHP version to 8.0
eclipxe13 Sep 12, 2025
2eeadac
Apply rector/rector changes
eclipxe13 Sep 12, 2025
7b69fea
Bump minimal PHP version to 8.1
eclipxe13 Sep 12, 2025
cb4642d
Apply rector/rector changes
eclipxe13 Sep 12, 2025
eac94c4
Last minute improvements (review using PHPStorm)
eclipxe13 Sep 12, 2025
7525ea9
Bump to PHP version 8.2
eclipxe13 Sep 12, 2025
97bc420
Upgrade to PHPUnit 10.5
eclipxe13 Sep 12, 2025
2897c8f
Do not check PHP version on run
eclipxe13 Sep 13, 2025
ffaf84f
Apply rector/rector changes (PHP 8.2)
eclipxe13 Sep 13, 2025
a0e96b2
Prepare version 0.3.0
eclipxe13 Sep 13, 2025
c91c320
Upgrade to PHPUnit 11.5
eclipxe13 Sep 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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:
Expand All @@ -39,7 +39,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:
Expand All @@ -56,7 +56,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:
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: composer:v2, cs2pr, phpstan
env:
Expand All @@ -97,7 +97,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -121,4 +121,4 @@ jobs:
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Tests (phpunit)
run: vendor/bin/phpunit --testdox --verbose
run: vendor/bin/phpunit --testdox
109 changes: 0 additions & 109 deletions .github/workflows/sonarcloud.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/sonarqube-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "SonarQube Cloud"
on:
workflow_dispatch:
push:
branches: [ "main" ]

# 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

jobs:

sonarqube-cloud:
name: SonarCloud Scan and Report
runs-on: "ubuntu-latest"
steps:
- name: Check SONAR_TOKEN secret
run: |
if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then
echo "::warning ::SONAR_TOKEN non set"
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
- name: Unshallow clone to provide blame information
run: git fetch --unshallow
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: xdebug
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@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@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 5 additions & 5 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcs" version="^3.10.3" installed="3.10.3" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.10.3" installed="3.10.3" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.64.0" installed="3.64.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.12.5" installed="1.12.5" location="./tools/phpstan" copy="false"/>
<phar name="composer-normalize" version="^2.44.0" installed="2.44.0" location="./tools/composer-normalize" copy="false"/>
<phar name="phpcs" version="^3.13.4" installed="3.13.4" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.13.4" installed="3.13.4" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.87.2" installed="3.87.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^2.1.25" installed="2.1.25" location="./tools/phpstan" copy="false"/>
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
</phive>
9 changes: 6 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PHP82Migration:risky' => true,
'@PHP82Migration' => 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', 'match', 'arguments', 'parameters']],
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => true,
Expand All @@ -35,16 +36,18 @@
'standardize_not_equals' => true,
'concat_space' => ['spacing' => 'one'],
'linebreak_after_opening_tag' => true,
'fully_qualified_strict_types' => true,
// symfony:risky
'no_alias_functions' => true,
'self_accessor' => true,
// contrib
'not_operator_with_successor_space' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], // @PSR12 sort_algorithm: none
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->append([__FILE__])
->exclude(['vendor', 'tools', 'build'])
->exclude(['vendor', 'tools', 'build']),
)
;
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 - 2024 PhpCfdi https://www.phpcfdi.com/
Copyright (c) 2021 - 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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,6 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/image-captcha-resolver/build.yml?branch=main&logo=github-actions
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_image-captcha-resolver&metric=reliability_rating
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_image-captcha-resolver&metric=sqale_rating
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_image-captcha-resolver/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_image-captcha-resolver/main?format=long&logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_image-captcha-resolver/main?logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_image-captcha-resolver/main?format=long&logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/image-captcha-resolver?logo=packagist
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "phpcfdi/image-captcha-resolver",
"description": "Conectores para resolver captchas de imágenes",
"license": "MIT",
"keywords": [],
"authors": [
{
"name": "Carlos C Soto",
Expand All @@ -16,7 +15,7 @@
"source": "https://github.com/phpcfdi/image-captcha-resolver"
},
"require": {
"php": ">=7.3",
"php": ">=8.2",
"ext-fileinfo": "*",
"ext-json": "*",
"php-http/discovery": "^1.14",
Expand All @@ -30,8 +29,8 @@
"guzzlehttp/psr7": "^2.0",
"php-http/guzzle7-adapter": "^1.0",
"php-http/mock-client": "^1.4",
"phpunit/phpunit": "^9.5",
"symfony/process": "^5.4 || ^6.4 || ^7.1",
"phpunit/phpunit": "^11.5",
"symfony/process": "^6.4 || ^7.1",
"vlucas/phpdotenv": "^5.3"
},
"suggest": {
Expand Down Expand Up @@ -63,21 +62,21 @@
"@dev:test"
],
"dev:check-style": [
"@php -r 'exit(intval(PHP_VERSION_ID >= 80000));' || $PHP_BINARY tools/composer-normalize normalize --dry-run",
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --dry-run --verbose || true",
"@php tools/composer-normalize normalize --dry-run",
"@php tools/php-cs-fixer fix --dry-run --verbose || true",
"@php tools/phpcs --colors -sp"
],
"dev:coverage": [
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/"
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --coverage-html build/coverage/html/"
],
"dev:fix-style": [
"@php -r 'exit(intval(PHP_VERSION_ID >= 80000));' || $PHP_BINARY tools/composer-normalize normalize",
"@php -r 'exit(intval(PHP_VERSION_ID >= 74000));' || $PHP_BINARY tools/php-cs-fixer fix --verbose",
"@php tools/composer-normalize normalize",
"@php tools/php-cs-fixer fix --verbose",
"@php tools/phpcbf --colors -sp"
],
"dev:test": [
"@dev:check-style",
"@php vendor/bin/phpunit --testdox --verbose --stop-on-failure",
"@php vendor/bin/phpunit --testdox --stop-on-failure",
"@php tools/phpstan analyse --no-progress --verbose"
]
},
Expand Down
18 changes: 18 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.

## Versión 0.3.0 2025-09-13

- Se revisa la compatibilidad de PHP 8.4.
- Se cambian las definiciones implícitas a tipos *nullables* a explícitas.
- Se actualizó el año de la licencia.
- Se hacen diversos cambios para asegurar los tipos de datos y satisfacer PHPStan.

Cambios de mantenimiento al entorno de desarrollo:

- Se normalizó `composer.json`.
- Se actualiza a PHPUnit 11.5.
- Se actualizan las reglas para `php-cs-fixer` y `phpcs`.
- En los flujos de trabajo de GitHub:
- Se agrega PHP 8.4 a la matrix de pruebas.
- Los trabajos se ejecutan en PHP 8.4.
- Se actualiza la integración con SonarQube Cloud.
- Se actualizaron las herramientas de desarrollo.

## Versión 0.2.4 2024-10-03

- Se agrega la compatibilidad de `symfony/process` a las versiones `6.x` y `7.x`.
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
Expand Down
Loading