Skip to content

Commit e5387ed

Browse files
authored
Merge pull request #16 from eclipxe13/maintenance-20230222
Mantenimiento 2023-02-22
2 parents 86daaec + a34cfb8 commit e5387ed

File tree

13 files changed

+183
-66
lines changed

13 files changed

+183
-66
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,78 @@ on:
1212

1313
jobs:
1414

15+
composer-normalize:
16+
name: Composer normalization
17+
runs-on: "ubuntu-latest"
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '8.2'
25+
coverage: none
26+
tools: composer-normalize
27+
env:
28+
fail-fast: true
29+
- name: Composer normalize
30+
run: composer-normalize
31+
1532
phpcs:
1633
name: Code style (phpcs)
1734
runs-on: "ubuntu-latest"
1835
steps:
1936
- name: Checkout
20-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
2138
- name: Setup PHP
2239
uses: shivammathur/setup-php@v2
2340
with:
24-
php-version: '8.0'
41+
php-version: '8.2'
2542
coverage: none
26-
tools: composer:v2, cs2pr, phpcs
43+
tools: cs2pr, phpcs
2744
env:
2845
fail-fast: true
2946
- name: Code style (phpcs)
30-
run: phpcs -q --report=checkstyle src/ tests/ | cs2pr
47+
run: phpcs -q --report=checkstyle | cs2pr
3148

3249
php-cs-fixer:
3350
name: Code style (php-cs-fixer)
3451
runs-on: "ubuntu-latest"
3552
steps:
3653
- name: Checkout
37-
uses: actions/checkout@v2
54+
uses: actions/checkout@v3
3855
- name: Setup PHP
3956
uses: shivammathur/setup-php@v2
4057
with:
41-
php-version: '8.0'
58+
php-version: '8.2'
4259
coverage: none
43-
tools: composer:v2, cs2pr, php-cs-fixer
60+
tools: cs2pr, php-cs-fixer
4461
env:
4562
fail-fast: true
4663
- name: Code style (php-cs-fixer)
4764
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
65+
env:
66+
PHP_CS_FIXER_IGNORE_ENV: 1
4867

4968
phpstan:
5069
name: Code analysis (phpstan)
5170
runs-on: "ubuntu-latest"
5271
steps:
5372
- name: Checkout
54-
uses: actions/checkout@v2
73+
uses: actions/checkout@v3
5574
- name: Setup PHP
5675
uses: shivammathur/setup-php@v2
5776
with:
58-
php-version: '8.0'
77+
php-version: '8.2'
5978
coverage: none
6079
tools: composer:v2, phpstan
6180
env:
6281
fail-fast: true
6382
- name: Get composer cache directory
6483
id: composer-cache
65-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
84+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6685
- name: Cache dependencies
67-
uses: actions/cache@v2
86+
uses: actions/cache@v3
6887
with:
6988
path: ${{ steps.composer-cache.outputs.dir }}
7089
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -79,10 +98,10 @@ jobs:
7998
runs-on: "ubuntu-latest"
8099
strategy:
81100
matrix:
82-
php-versions: ['7.3', '7.4', '8.0', '8.1']
101+
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
83102
steps:
84103
- name: Checkout
85-
uses: actions/checkout@v2
104+
uses: actions/checkout@v3
86105
- name: Setup PHP
87106
uses: shivammathur/setup-php@v2
88107
with:
@@ -93,9 +112,9 @@ jobs:
93112
fail-fast: true
94113
- name: Get composer cache directory
95114
id: composer-cache
96-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
115+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
97116
- name: Cache dependencies
98-
uses: actions/cache@v2
117+
uses: actions/cache@v3
99118
with:
100119
path: ${{ steps.composer-cache.outputs.dir }}
101120
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/coverage.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
runs-on: "ubuntu-latest"
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '8.0'
21+
php-version: '8.2'
2222
coverage: xdebug
2323
tools: composer:v2
2424
env:
2525
fail-fast: true
2626
- name: Get composer cache directory
2727
id: composer-cache
28-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
28+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2929
- name: Cache dependencies
30-
uses: actions/cache@v2
30+
uses: actions/cache@v3
3131
with:
3232
path: ${{ steps.composer-cache.outputs.dir }}
3333
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -37,7 +37,7 @@ jobs:
3737
- name: Create code coverage
3838
run: vendor/bin/phpunit --testdox --verbose --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
3939
- name: Store code coverage
40-
uses: actions/upload-artifact@v2
40+
uses: actions/upload-artifact@v3
4141
with:
4242
name: code-coverage
4343
path: build/coverage
@@ -53,15 +53,15 @@ jobs:
5353
id: check-secrets
5454
run: |
5555
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then
56-
echo "::set-output name=github::yes"
56+
echo "github=yes" >> $GITHUB_OUTPUT
5757
else
58-
echo "::set-output name=github::no"
58+
echo "github=no" >> $GITHUB_OUTPUT
5959
echo "::warning ::GITHUB_TOKEN non set"
6060
fi
6161
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then
62-
echo "::set-output name=sonar::yes"
62+
echo "sonar=yes" >> $GITHUB_OUTPUT
6363
else
64-
echo "::set-output name=sonar::no"
64+
echo "sonar=no" >> $GITHUB_OUTPUT
6565
echo "::warning ::SONAR_TOKEN non set"
6666
fi
6767
@@ -72,28 +72,28 @@ jobs:
7272
runs-on: "ubuntu-latest"
7373
steps:
7474
- name: Checkout
75-
uses: actions/checkout@v2
75+
uses: actions/checkout@v3
7676
- name: Unshallow clone to provide blame information
7777
run: git fetch --unshallow
7878
- name: Setup PHP
7979
uses: shivammathur/setup-php@v2
8080
with:
81-
php-version: '8.0'
81+
php-version: '8.2'
8282
coverage: none
8383
tools: composer:v2
8484
- name: Get composer cache directory
8585
id: composer-cache
86-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
86+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8787
- name: Cache dependencies
88-
uses: actions/cache@v2
88+
uses: actions/cache@v3
8989
with:
9090
path: ${{ steps.composer-cache.outputs.dir }}
9191
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
9292
restore-keys: ${{ runner.os }}-composer-
9393
- name: Install project dependencies
9494
run: composer upgrade --no-interaction --no-progress --prefer-dist
9595
- name: Obtain code coverage
96-
uses: actions/download-artifact@v2
96+
uses: actions/download-artifact@v3
9797
with:
9898
name: code-coverage
9999
path: build/coverage

.phive/phars.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +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.5.0" installed="3.5.0" location="./tools/php-cs-fixer" copy="false"/>
4-
<phar name="phpcs" version="^3.6.2" installed="3.6.2" location="./tools/phpcs" copy="false"/>
5-
<phar name="phpcbf" version="^3.6.2" installed="3.6.2" location="./tools/phpcbf" copy="false"/>
6-
<phar name="phpstan" version="^1.4.4" installed="1.4.4" location="./tools/phpstan" copy="false"/>
3+
<phar name="php-cs-fixer" version="^3.14.4" installed="3.14.4" location="./tools/php-cs-fixer" copy="false"/>
4+
<phar name="phpcs" version="^3.7.1" installed="3.7.1" location="./tools/phpcs" copy="false"/>
5+
<phar name="phpcbf" version="^3.7.1" installed="3.7.1" location="./tools/phpcbf" copy="false"/>
6+
<phar name="phpstan" version="^1.10.1" installed="1.10.1" location="./tools/phpstan" copy="false"/>
7+
<phar name="composer-normalize" version="^2.29.0" installed="2.29.0" location="./tools/composer-normalize" copy="false"/>
78
</phive>

.php-cs-fixer.dist.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,43 @@
1111

1212
return (new PhpCsFixer\Config())
1313
->setRiskyAllowed(true)
14-
->setCacheFile(__DIR__ . '/build/php_cs.cache')
14+
->setCacheFile(__DIR__ . '/build/php-cs-fixer.cache')
1515
->setRules([
1616
'@PSR12' => true,
1717
'@PSR12:risky' => true,
1818
'@PHP71Migration:risky' => true,
1919
'@PHP73Migration' => true,
20-
// PSR12 (remove when php-cs-fixer reaches ^3.1.1)
21-
'class_definition' => ['space_before_parenthesis' => true],
2220
// symfony
23-
// 'class_attributes_separation' => true, // conflict with PSR12
21+
'class_attributes_separation' => true,
2422
'whitespace_after_comma_in_array' => true,
2523
'no_empty_statement' => true,
2624
'no_extra_blank_lines' => true,
2725
'function_typehint_space' => true,
26+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']],
2827
'no_blank_lines_after_phpdoc' => true,
2928
'object_operator_without_whitespace' => true,
3029
'binary_operator_spaces' => true,
3130
'phpdoc_scalar' => true,
32-
'no_trailing_comma_in_singleline_array' => true,
31+
'no_trailing_comma_in_singleline' => true,
3332
'single_quote' => true,
3433
'no_singleline_whitespace_before_semicolons' => true,
3534
'no_unused_imports' => true,
3635
'yoda_style' => ['equal' => true, 'identical' => true, 'less_and_greater' => null],
3736
'standardize_not_equals' => true,
3837
'concat_space' => ['spacing' => 'one'],
3938
'linebreak_after_opening_tag' => true,
39+
'fully_qualified_strict_types' => true,
4040
// symfony:risky
4141
'no_alias_functions' => true,
4242
'self_accessor' => true,
4343
// contrib
4444
'not_operator_with_successor_space' => true,
45+
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], // @PSR12 sort_algorithm: none
4546
])
4647
->setFinder(
4748
PhpCsFixer\Finder::create()
4849
->in(__DIR__)
4950
->append([__FILE__])
50-
->exclude(['vendor', 'build'])
51+
->exclude(['vendor', 'tools', 'build']),
5152
)
5253
;

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contribuciones
22

3-
Las contribuciones son bienvenidas. Aceptamos *Pull Requests* en el [repositorio GitHub][homepage].
3+
Las contribuciones son bienvenidas. Aceptamos *Pull Requests* en el [repositorio GitHub][project].
44

55
Este proyecto se apega al siguiente [Código de Conducta][coc].
66
Al participar en este proyecto y en su comunidad, deberás seguir este código.

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) 2019 - 2022 PhpCfdi https://www.phpcfdi.com/
3+
Copyright (c) 2019 - 2023 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
158158
[badge-php-version]: https://img.shields.io/packagist/php-v/phpcfdi/credentials?logo=php
159159
[badge-release]: https://img.shields.io/github/release/phpcfdi/credentials?logo=git
160160
[badge-license]: https://img.shields.io/github/license/phpcfdi/credentials?logo=open-source-initiative
161-
[badge-build]: https://img.shields.io/github/workflow/status/phpcfdi/credentials/build/main?logo=github-actions
161+
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/credentials/build.yml?branch=main&logo=github-actions
162162
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_credentials&metric=reliability_rating
163163
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_credentials&metric=sqale_rating
164164
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_credentials/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io

composer.json

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"name": "phpcfdi/credentials",
33
"description": "Library to use eFirma (fiel) and CSD (sellos) from SAT",
4-
"keywords": ["efirma", "fiel", "sat", "cfdi", "sello", "certificado"],
5-
"homepage": "https://github.com/phpcfdi/credentials",
64
"license": "MIT",
5+
"keywords": [
6+
"efirma",
7+
"fiel",
8+
"sat",
9+
"cfdi",
10+
"sello",
11+
"certificado"
12+
],
713
"authors": [
814
{
915
"name": "Carlos C Soto",
1016
"email": "[email protected]"
1117
}
1218
],
19+
"homepage": "https://github.com/phpcfdi/credentials",
1320
"support": {
14-
"source": "https://github.com/phpcfdi/credentials",
15-
"issues": "https://github.com/phpcfdi/credentials/issues"
16-
},
17-
"prefer-stable": true,
18-
"config": {
19-
"optimize-autoloader": true,
20-
"preferred-install": {
21-
"*": "dist"
22-
}
21+
"issues": "https://github.com/phpcfdi/credentials/issues",
22+
"source": "https://github.com/phpcfdi/credentials"
2323
},
2424
"require": {
2525
"php": ">=7.3",
@@ -31,6 +31,7 @@
3131
"ext-json": "*",
3232
"phpunit/phpunit": "^9.5"
3333
},
34+
"prefer-stable": true,
3435
"autoload": {
3536
"psr-4": {
3637
"PhpCfdi\\Credentials\\": "src/"
@@ -41,30 +42,41 @@
4142
"PhpCfdi\\Credentials\\Tests\\": "tests/"
4243
}
4344
},
45+
"config": {
46+
"optimize-autoloader": true,
47+
"preferred-install": {
48+
"*": "dist"
49+
}
50+
},
4451
"scripts": {
45-
"dev:build": ["@dev:fix-style", "@dev:test"],
52+
"dev:build": [
53+
"@dev:fix-style",
54+
"@dev:check-style",
55+
"@dev:test"
56+
],
4657
"dev:check-style": [
58+
"@php tools/composer-normalize normalize --dry-run",
4759
"@php tools/php-cs-fixer fix --dry-run --verbose",
4860
"@php tools/phpcs --colors -sp"
4961
],
62+
"dev:coverage": [
63+
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/"
64+
],
5065
"dev:fix-style": [
66+
"@php tools/composer-normalize normalize",
5167
"@php tools/php-cs-fixer fix --verbose",
5268
"@php tools/phpcbf --colors -sp"
5369
],
5470
"dev:test": [
55-
"@dev:check-style",
5671
"@php vendor/bin/phpunit --testdox --verbose --stop-on-failure",
57-
"@php tools/phpstan analyse --no-progress"
58-
],
59-
"dev:coverage": [
60-
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/"
72+
"@php tools/phpstan analyse --no-progress --verbose"
6173
]
6274
},
6375
"scripts-descriptions": {
64-
"dev:build": "DEV: run dev:fix-style and dev:tests, run before pull request",
65-
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
66-
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
67-
"dev:test": "DEV: run dev:check-style, phpunit and phpstan",
68-
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
76+
"dev:build": "DEV: run dev:fix-style dev:check-style and dev:tests, run before pull request",
77+
"dev:check-style": "DEV: search for code style errors using composer-normalize, php-cs-fixer and phpcs",
78+
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/",
79+
"dev:fix-style": "DEV: fix code style errors using composer-normalize, php-cs-fixer and phpcbf",
80+
"dev:test": "DEV: run phpunit and phpstan"
6981
}
7082
}

0 commit comments

Comments
 (0)