Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f5db5f6
Test Persona::getRegimenes()
eclipxe13 Jun 17, 2023
f56ec13
Fix release notes on 0.1.6
eclipxe13 Jun 17, 2023
462b03a
Run GitHub action on version 4
eclipxe13 Nov 10, 2025
1ebf817
Remove deprecated rule
eclipxe13 Nov 10, 2025
9ded718
Use php-version variable (singular)
eclipxe13 Nov 10, 2025
7ff26bf
Remove duplicated test
eclipxe13 Nov 10, 2025
e8ee9e6
Fix fully qualified strict types (code standard)
eclipxe13 Nov 10, 2025
baf484a
Update code standards for ph-pcs-fixer
eclipxe13 Nov 10, 2025
c70de71
Update development tools
eclipxe13 Nov 10, 2025
6cc8bf9
Upgrade to PHPStan 2.x and resolve issues
eclipxe13 Nov 10, 2025
ba089ac
Add PHP 8.3 & PHP 8.4 to test matrix
eclipxe13 Nov 10, 2025
ecd3991
Run jobs using PHP 8.4
eclipxe13 Nov 10, 2025
5dad3a9
Add composer-normalize development tool
eclipxe13 Nov 10, 2025
ad18ed9
Normalize composer.json using composer-normalize
eclipxe13 Nov 10, 2025
b4beb8c
Fix `composer validate` warning dependence
eclipxe13 Nov 10, 2025
270e414
Update license year to 2025
eclipxe13 Nov 10, 2025
32a0b56
Fix SonarQube Cloud integration
eclipxe13 Nov 10, 2025
3758bee
Leave only one step for set up php
eclipxe13 Nov 10, 2025
241f90a
Bump to PHP 8.1
eclipxe13 Nov 10, 2025
c93ace6
Bump to PHP 8.2
eclipxe13 Nov 10, 2025
4b67944
Clean up code
eclipxe13 Nov 10, 2025
0281804
Static var Scraper::$url used as static and not self
eclipxe13 Nov 10, 2025
63d84fb
As of PHP 8.2, symfony dependeces can be set to ^7.0
eclipxe13 Nov 10, 2025
e0c91ac
Add job composer-require-checker
eclipxe13 Nov 10, 2025
8d66c73
Reorder development tools
eclipxe13 Nov 10, 2025
6ad1b84
Upgrade to PHPUnit 11.5
eclipxe13 Nov 11, 2025
1672eb4
Review docblocks
eclipxe13 Nov 11, 2025
110a218
Use operating-system variable (singular)
eclipxe13 Nov 11, 2025
295e6bb
Prepare version 0.2.0
eclipxe13 Nov 11, 2025
7e8e4cd
Catch `ClientExceptionInterface` instead of `GuzzleException`
eclipxe13 Nov 11, 2025
8d9dcaa
Use Scraper::create()
eclipxe13 Nov 11, 2025
5c68197
Use correct variable name `$response`
eclipxe13 Nov 11, 2025
5e45426
Expect correct exception CfdiNotFoundException
eclipxe13 Nov 11, 2025
d30383a
Test CifDownloadException
eclipxe13 Nov 11, 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
90 changes: 63 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,62 @@ on:

jobs:

composer-normalize:
name: Composer normalization
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
tools: composer-normalize
env:
fail-fast: true
- name: Composer normalize
run: composer-normalize --dry-run

composer-require-checker:
name: Composer require checker
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
tools: composer-require-checker
env:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
shell: bash
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: Composer require checker
run: composer-require-checker

phpcs:
name: Code style (phpcs)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.4'
coverage: none
tools: cs2pr, phpcs
env:
Expand All @@ -35,11 +81,11 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.4'
coverage: none
tools: cs2pr, php-cs-fixer
env:
Expand All @@ -52,11 +98,11 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.4'
coverage: none
tools: composer:v2, phpstan
env:
Expand All @@ -66,7 +112,7 @@ jobs:
shell: bash
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') }}
Expand All @@ -77,35 +123,25 @@ jobs:
run: phpstan analyse --no-progress --verbose

tests:
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-systems }}
runs-on: ${{ matrix.operating-systems }}
name: PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-systems: ["windows-latest", "ubuntu-latest"]
php-versions: ['8.0', '8.1', '8.2']
operating-system: ["windows-latest", "ubuntu-latest"]
php-version: ['8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP on Linux
if: matrix.operating-systems == 'ubuntu-latest'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer:v2
env:
fail-fast: true
- name: Setup PHP on Windows
if: matrix.operating-systems == 'windows-latest'
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2
env:
fail-fast: true
- name: Install poppler-utils
if: matrix.operating-systems == 'ubuntu-latest'
if: matrix.operating-system == 'ubuntu-latest'
run: |
sudo apt-get update -y -qq
sudo apt-get install -y poppler-utils
Expand All @@ -114,12 +150,12 @@ jobs:
shell: bash
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') }}
restore-keys: ${{ runner.os }}-composer-
- 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
113 changes: 0 additions & 113 deletions .github/workflows/sonarcloud.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/sonarqube-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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@v6 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: Install poppler-utils
run: |
sudo apt-get update -y -qq
sudo apt-get install -y poppler-utils
- 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@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 6 additions & 5 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="^1.10.55" installed="1.10.55" location="./tools/phpstan" copy="false"/>
<phar name="phpcs" version="^3.7.2" installed="3.8.0" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.7.2" installed="3.8.0" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.46.0" installed="3.46.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="composer-require-checker" version="^4.6.0" installed="4.8.0" location="./tools/composer-require-checker" copy="false"/>
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
<phar name="php-cs-fixer" version="^3.89.2" installed="3.89.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.13.5" installed="3.13.5" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.13.5" installed="3.13.5" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^2.1.31" installed="2.1.31" location="./tools/phpstan" copy="false"/>
<phar name="composer-require-checker" version="^4.18.0" installed="4.18.0" location="./tools/composer-require-checker" copy="false"/>
</phive>
11 changes: 7 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'@PHP8x2Migration' => true,
'@PHP8x2Migration:risky' => true,
// symfony
'array_indentation' => true,
'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']],
'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,
Expand All @@ -36,6 +37,8 @@
'standardize_not_equals' => true,
'concat_space' => ['spacing' => 'one'],
'linebreak_after_opening_tag' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => ['import_classes' => true],
// symfony:risky
'no_alias_functions' => true,
'self_accessor' => true,
Expand All @@ -47,6 +50,6 @@
PhpCsFixer\Finder::create()
->in(__DIR__)
->append([__FILE__])
->exclude(['tools', 'vendor', 'build'])
->exclude(['tools', 'vendor', 'build']),
)
;
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 - 2024 PhpCfdi https://www.phpcfdi.com/
Copyright (c) 2022 - 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
Loading