Skip to content

Commit b6d0ead

Browse files
authored
Merge pull request #5 from eclipxe13/version-0.3.0
Actualizar dependencias del proyecto (versión 0.3.0)
2 parents 1c0688e + 0a93848 commit b6d0ead

39 files changed

Lines changed: 202 additions & 236 deletions

.github/workflows/build.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,34 @@ on:
1212
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action
1313

1414
jobs:
15+
16+
composer-normalize:
17+
name: Composer normalization
18+
runs-on: "ubuntu-latest"
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.5'
26+
coverage: none
27+
tools: composer-normalize
28+
env:
29+
fail-fast: true
30+
- name: Composer normalize
31+
run: composer-normalize --dry-run
32+
1533
phpcs:
1634
name: Coding standards (phpcs)
1735
runs-on: "ubuntu-latest"
1836
steps:
1937
- name: Checkout
20-
uses: actions/checkout@v3
38+
uses: actions/checkout@v6
2139
- name: Setup PHP
2240
uses: shivammathur/setup-php@v2
2341
with:
24-
php-version: '8.3'
42+
php-version: '8.5'
2543
coverage: none
2644
tools: cs2pr, phpcs
2745
env:
@@ -34,11 +52,11 @@ jobs:
3452
runs-on: "ubuntu-latest"
3553
steps:
3654
- name: Checkout
37-
uses: actions/checkout@v3
55+
uses: actions/checkout@v6
3856
- name: Setup PHP
3957
uses: shivammathur/setup-php@v2
4058
with:
41-
php-version: '8.3'
59+
php-version: '8.5'
4260
coverage: none
4361
tools: cs2pr, php-cs-fixer
4462
env:
@@ -51,10 +69,10 @@ jobs:
5169
runs-on: "ubuntu-latest"
5270
strategy:
5371
matrix:
54-
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
72+
php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5']
5573
steps:
5674
- name: Checkout
57-
uses: actions/checkout@v3
75+
uses: actions/checkout@v6
5876
- name: Setup PHP
5977
uses: shivammathur/setup-php@v2
6078
with:
@@ -68,7 +86,7 @@ jobs:
6886
id: composer-cache
6987
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7088
- name: Cache dependencies
71-
uses: actions/cache@v3
89+
uses: actions/cache@v4
7290
with:
7391
path: ${{ steps.composer-cache.outputs.dir }}
7492
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -83,11 +101,11 @@ jobs:
83101
runs-on: "ubuntu-latest"
84102
steps:
85103
- name: Checkout
86-
uses: actions/checkout@v3
104+
uses: actions/checkout@v6
87105
- name: Setup PHP
88106
uses: shivammathur/setup-php@v2
89107
with:
90-
php-version: '8.3'
108+
php-version: '8.5'
91109
extensions: bcmath
92110
coverage: none
93111
tools: composer:v2, phpstan
@@ -97,7 +115,7 @@ jobs:
97115
id: composer-cache
98116
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
99117
- name: Cache dependencies
100-
uses: actions/cache@v3
118+
uses: actions/cache@v4
101119
with:
102120
path: ${{ steps.composer-cache.outputs.dir }}
103121
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/coverage.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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@v7 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 "$SONAR_TOKEN" ]; then
20+
echo "::warning ::SONAR_TOKEN non set"
21+
exit 1
22+
fi
23+
env:
24+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
with:
28+
fetch-depth: 0 # Disabling shallow clones is recommended for improving the relevancy of reporting
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: '8.5'
33+
extensions: bcmath
34+
coverage: xdebug
35+
tools: composer:v2
36+
env:
37+
fail-fast: true
38+
- name: Get composer cache directory
39+
id: composer-cache
40+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
41+
- name: Cache dependencies
42+
uses: actions/cache@v4
43+
with:
44+
path: ${{ steps.composer-cache.outputs.dir }}
45+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
46+
restore-keys: ${{ runner.os }}-composer-
47+
- name: Install project dependencies
48+
run: composer upgrade --no-interaction --no-progress --prefer-dist
49+
- name: Create code coverage
50+
run: vendor/bin/phpunit --testdox --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
51+
- name: Prepare SonarCloud Code Coverage Files
52+
run: |
53+
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/junit.xml > build/sonar-junit.xml
54+
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/clover.xml > build/sonar-coverage.xml
55+
- name: SonarCloud Scan
56+
uses: SonarSource/sonarqube-scan-action@v7
57+
env:
58+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.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.41.1" installed="3.41.1" location="./tools/php-cs-fixer" copy="false"/>
4-
<phar name="phpcs" version="^3.8.0" installed="3.8.0" location="./tools/phpcs" copy="false"/>
5-
<phar name="phpcbf" version="^3.8.0" installed="3.8.0" location="./tools/phpcbf" copy="false"/>
6-
<phar name="phpstan" version="^1.10.50" installed="1.10.50" location="./tools/phpstan" copy="false"/>
3+
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
4+
<phar name="php-cs-fixer" version="^3.92.5" installed="3.92.5" location="./tools/php-cs-fixer" copy="false"/>
5+
<phar name="phpcs" version="^4.0.1" installed="4.0.1" location="./tools/phpcs" copy="false"/>
6+
<phar name="phpcbf" version="^4.0.1" installed="4.0.1" location="./tools/phpcbf" copy="false"/>
7+
<phar name="phpstan" version="^2.1.36" installed="2.1.36" location="./tools/phpstan" copy="false"/>
78
</phive>

.php-cs-fixer.dist.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
->setRules([
1616
'@PSR12' => true,
1717
'@PSR12:risky' => true,
18-
'@PHP74Migration' => true,
19-
'@PHP74Migration:risky' => true,
18+
'@PHP8x1Migration' => true,
19+
'@PHP8x1Migration:risky' => 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', 'arguments']],
26+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'arguments', 'parameters']],
2727
'no_blank_lines_after_phpdoc' => true,
2828
'object_operator_without_whitespace' => true,
2929
'binary_operator_spaces' => true,

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 - 2023 PhpCfdi https://www.phpcfdi.com/
3+
Copyright (c) 2021 - 2026 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
@@ -1,7 +1,7 @@
11
# phpcfdi/ceutils
22

33
[![Source Code][badge-source]][source]
4-
[![Packagist PHP Version Support][badge-php-version]][php-version]
4+
[![PHP Version][badge-php-version]][php-version]
55
[![Discord][badge-discord]][discord]
66
[![Latest Version][badge-release]][release]
77
[![Software License][badge-license]][license]

composer.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"name": "phpcfdi/ceutils",
33
"description": "PHP library for Mexican SAT Electronic Accounting 1.3",
4+
"license": "MIT",
45
"keywords": [
56
"mexico",
67
"sat",
78
"contabilidad electrónica",
89
"póliza",
910
"balanza"
1011
],
11-
"homepage": "https://github.com/PhpCfdi/CeUtils",
12-
"license": "MIT",
1312
"authors": [
1413
{
1514
"name": "Cesar Aguilera",
@@ -20,18 +19,18 @@
2019
"email": "eclipxe13@gmail.com"
2120
}
2221
],
22+
"homepage": "https://github.com/PhpCfdi/CeUtils",
2323
"require": {
24-
"php": ">=7.4",
24+
"php": ">=8.1",
2525
"ext-bcmath": "*",
26-
"ext-openssl": "*",
2726
"ext-dom": "*",
28-
"eclipxe/cfdiutils": "^v2.23.3",
29-
"eclipxe/xmlresourceretriever": "^1.3.2",
30-
"eclipxe/xmlschemavalidator": "^3.0.2",
31-
"phpcfdi/credentials": "^1.1.3"
27+
"ext-openssl": "*",
28+
"eclipxe/cfdiutils": "^3.0.2",
29+
"eclipxe/xmlresourceretriever": "^2.0.3",
30+
"eclipxe/xmlschemavalidator": "^3.0.5",
31+
"phpcfdi/credentials": "^1.3.0"
3232
},
3333
"require-dev": {
34-
"ergebnis/composer-normalize": "^2.15",
3534
"phpunit/phpunit": "^9.5"
3635
},
3736
"autoload": {
@@ -44,13 +43,9 @@
4443
"PhpCfdi\\CeUtils\\Tests\\": "tests/"
4544
}
4645
},
47-
"config": {
48-
"allow-plugins": {
49-
"ergebnis/composer-normalize": true
50-
}
51-
},
5246
"scripts": {
5347
"dev:build": [
48+
"@php tools/composer-normalize normalize --dry-run",
5449
"@dev:fix-style",
5550
"@dev:test"
5651
],
@@ -62,6 +57,7 @@
6257
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --verbose --coverage-html build/coverage/html/"
6358
],
6459
"dev:fix-style": [
60+
"@php tools/composer-normalize normalize",
6561
"@php tools/php-cs-fixer fix --verbose",
6662
"@php tools/phpcbf --colors -sp"
6763
],
@@ -73,9 +69,9 @@
7369
},
7470
"scripts-descriptions": {
7571
"dev:build": "DEV: run dev:fix-style and dev:tests, run before pull request",
76-
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
72+
"dev:check-style": "DEV: search for code style errors using composer-normalize, php-cs-fixer and phpcs",
7773
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/",
78-
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
74+
"dev:fix-style": "DEV: fix code style errors using composer-normalize, php-cs-fixer and phpcbf",
7975
"dev:test": "DEV: run dev:check-style, phpunit and phpstan"
8076
}
8177
}

0 commit comments

Comments
 (0)