Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.scrutinizer.yml export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
sonar-project.properties export-ignore

# Do not count these files on github code language
/tests/_files/** linguist-detectable=false
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: composer-normalize
env:
fail-fast: true
- name: Composer normalize
run: composer-normalize
run: composer-normalize --dry-run

phpcs:
name: Code style (phpcs)
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, phpstan
extensions: soap
Expand All @@ -98,7 +98,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.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -123,4 +123,4 @@ jobs:
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Tests (phpunit)
run: vendor/bin/phpunit tests/Unit/ --testdox --verbose
run: vendor/bin/phpunit tests/Unit/ --testdox
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
name: functional-tests
name: "SonarQube Cloud"
on:
# secrets are not passed to workflows that are triggered by a pull request from a fork.
# see https://docs.github.com/en/actions/reference/encrypted-secrets
workflow_dispatch:
push:
branches: [ 'main' ]
branches: [ "main" ]

# Actions
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action
# sudo-bot/action-scrutinizer@latest https://github.com/marketplace/actions/action-scrutinizer
# SonarSource/sonarqube-scan-action@v6 https://github.com/marketplace/actions/official-sonarqube-scan

jobs:
functional-tests:
name: Functional tests
runs-on: "ubuntu-latest"

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: Check ENV_GPG_SECRET secret
run: |
if [ -z "${{ secrets.ENV_GPG_SECRET }}" ]; then
echo "::warning ::ENV_GPG_SECRET non set"
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for sudo-bot/action-scrutinizer

- name: Unshallow clone to provide blame information
run: git fetch --unshallow
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
extensions: soap
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: Install SAT XML resources
shell: bash
run: |
git clone --depth 1 https://github.com/phpcfdi/resources-sat-xml resources-sat-xml-cloned
mv resources-sat-xml-cloned/resources vendor/eclipxe/cfdiutils/build/resources
rm -r -f resources-sat-xml-cloned

- name: Set up environment file
run: gpg --quiet --batch --yes --decrypt --passphrase="$ENV_GPG_SECRET" --output tests/.env tests/.env-testing.enc
env:
ENV_GPG_SECRET: ${{ secrets.ENV_GPG_SECRET }}

- name: Run integration tests with code coverage
run: vendor/bin/phpunit --testdox --verbose --exclude-group large --coverage-clover=build/coverage-clover.xml

- name: Upload code coverage to scrutinizer
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage-clover.xml"
continue-on-error: true
- name: Create code coverage
run: vendor/bin/phpunit --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 }}
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.9.1" installed="3.9.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.9.1" installed="3.9.1" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.53.0" installed="3.53.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.10.66" installed="1.10.66" location="./tools/phpstan" copy="false"/>
<phar name="composer-normalize" version="^2.42.0" installed="2.42.0" location="./tools/composer-normalize" 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="php-cs-fixer" version="^3.89.2" installed="3.89.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^2.1.31" installed="2.1.31" location="./tools/phpstan" copy="false"/>
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
</phive>
7 changes: 4 additions & 3 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,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PHP8x1Migration' => true,
'@PHP8x0Migration: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' => ['arrays', 'match', 'parameters']],
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => true,
Expand Down
19 changes: 0 additions & 19 deletions .scrutinizer.yml

This file was deleted.

3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Lee y configura tu proyecto de acuerdo a la guía de configuración del [entorno
Una vez correctamente configurado, ejecuta las pruebas de integración:

```shell
vendor/bin/phpunit tests/Integration --testdox --verbose
vendor/bin/phpunit tests/Integration --testdox
```

## Ejecutar GitHub Actions localmente
Expand All @@ -97,7 +97,6 @@ puedes ejecutar el siguiente comando:

```shell
act -P ubuntu-latest=shivammathur/node:latest -W .github/workflows/build.yml
act -P ubuntu-latest=shivammathur/node:latest -W .github/workflows/functional-tests.yml -s ENV_GPG_SECRET=**********
```


Expand Down
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) 2019 - 2024 PhpCfdi https://www.phpcfdi.com/
Copyright (c) 2019 - 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
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# phpcfdi/finkok

[![Source Code][badge-source]][source]
[![Packagist PHP Version Support][badge-php-version]][php-version]
[![Discord][badge-discord]][discord]
[![Latest Version][badge-release]][release]
[![Software License][badge-license]][license]
[![Build Status][badge-build]][build]
[![Scrutinizer][badge-quality]][quality]
[![Coverage Status][badge-coverage]][coverage]
[![Reliability][badge-reliability]][reliability]
[![Maintainability][badge-maintainability]][maintainability]
[![Code Coverage][badge-coverage]][coverage]
[![Violations][badge-violations]][violations]
[![Total Downloads][badge-downloads]][downloads]

> Librería para conectar con la API de servicios de FINKOK (México)

:us: The documentation of this project is in spanish as this is the natural language for intented audience.
:us: The documentation of this project is in spanish as this is the natural language for intended audience.

## Acerca de phpcfdi/finkok

Expand Down Expand Up @@ -295,6 +299,7 @@ sin temor a romper tu aplicación.
|------------------------|-------------------------------|----------------------|
| 0.1.0 | 7.2, 7.3 y 7.4 | 2019-03-29 |
| 0.3.0 | 7.3, 7.4, 8.0, 8.1, 8.2 y 8.3 | 2021-03-18 |
| 0.6.0 | 8.1, 8.2, 8.3 y 8.4 | 2025-11-08 |

## Contribuciones

Expand All @@ -311,17 +316,25 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[todo]: https://github.com/phpcfdi/finkok/blob/main/docs/TODO.md

[source]: https://github.com/phpcfdi/finkok
[php-version]: https://packagist.org/packages/phpcfdi/finkok
[discord]: https://discord.gg/aFGYXvX
[release]: https://github.com/phpcfdi/finkok/releases
[license]: https://github.com/phpcfdi/finkok/blob/main/LICENSE
[build]: https://github.com/phpcfdi/finkok/actions/workflows/build.yml?query=branch:main
[quality]: https://scrutinizer-ci.com/g/phpcfdi/finkok/
[coverage]: https://scrutinizer-ci.com/g/phpcfdi/finkok/code-structure/main/code-coverage/src
[reliability]:https://sonarcloud.io/component_measures?id=phpcfdi_finkok&metric=Reliability
[maintainability]: https://sonarcloud.io/component_measures?id=phpcfdi_finkok&metric=Maintainability
[coverage]: https://sonarcloud.io/component_measures?id=phpcfdi_finkok&metric=Coverage
[violations]: https://sonarcloud.io/project/issues?id=phpcfdi_finkok&resolved=false
[downloads]: https://packagist.org/packages/phpcfdi/finkok

[badge-source]: https://img.shields.io/badge/source-phpcfdi/finkok-blue?style=flat-square
[badge-release]: https://img.shields.io/github/release/phpcfdi/finkok?style=flat-square
[badge-license]: https://img.shields.io/github/license/phpcfdi/finkok?style=flat-square
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/finkok/build.yml?branch=main&style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/phpcfdi/finkok/main?style=flat-square
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/phpcfdi/finkok/main?style=flat-square
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/finkok?style=flat-square
[badge-source]: https://img.shields.io/badge/source-phpcfdi/finkok-blue?logo=github
[badge-discord]: https://img.shields.io/discord/459860554090283019?logo=discord
[badge-php-version]: https://img.shields.io/packagist/php-v/phpcfdi/finkok?logo=php
[badge-release]: https://img.shields.io/github/release/phpcfdi/finkok?logo=git
[badge-license]: https://img.shields.io/github/license/phpcfdi/finkok?logo=open-source-initiative
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/finkok/build.yml?branch=main&logo=github-actions
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_finkok&metric=reliability_rating
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_finkok&metric=sqale_rating
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_finkok/main?logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
[badge-violations]: https://img.shields.io/sonar/violations/phpcfdi_finkok/main?format=long&logo=sonarqubecloud&server=https%3A%2F%2Fsonarcloud.io
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/finkok?logo=packagist
29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@
"source": "https://github.com/phpcfdi/finkok"
},
"require": {
"php": ">=7.3",
"php": ">=8.1",
"ext-dom": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-soap": "*",
"eclipxe/enum": "^0.2.0",
"eclipxe/micro-catalog": "^0.1.0",
"phpcfdi/cfdi-expresiones": "^3.2",
"phpcfdi/credentials": "^1.0.1",
"phpcfdi/xml-cancelacion": "^2.0.2",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"robrichards/xmlseclibs": "^3.0.4"
"eclipxe/enum": "^0.2.7",
"eclipxe/micro-catalog": "^0.1.4",
"phpcfdi/cfdi-expresiones": "^3.3.0",
"phpcfdi/credentials": "^1.3.0",
"phpcfdi/xml-cancelacion": "^2.0.5",
"psr/log": "^3.0",
"robrichards/xmlseclibs": "^3.1.3"
},
"require-dev": {
"ext-fileinfo": "*",
"eclipxe/cfdiutils": "^2.23.2",
"phpcfdi/rfc": "^1.1",
"phpunit/phpunit": "^9.5.10",
"symfony/dotenv": "^5.1 || ^6.0 || ^7.0"
"eclipxe/cfdiutils": "^3.0.1",
"phpcfdi/rfc": "^1.2",
"phpunit/phpunit": "^10.5",
"rector/rector": "^2.2",
"symfony/dotenv": "^6.0 || ^7.0"
},
"prefer-stable": true,
"autoload": {
Expand Down Expand Up @@ -70,15 +71,15 @@
"@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 tools/composer-normalize normalize",
"@php tools/php-cs-fixer fix --verbose",
"@php tools/phpcbf --colors -sp"
],
"dev:test": [
"@php vendor/bin/phpunit --testdox --verbose --stop-on-failure tests/Unit",
"@php vendor/bin/phpunit --testdox --stop-on-failure tests/Unit",
"@php tools/phpstan analyse --no-progress --verbose"
]
},
Expand Down
Loading