Skip to content

Commit fe9f96b

Browse files
authored
Merge pull request #24 from eclipxe13/maintenance
Mantenimiento 2025-09-25
2 parents 2307eb2 + 51fe59d commit fe9f96b

8 files changed

Lines changed: 70 additions & 116 deletions

File tree

.github/workflows/sonarcloud.yml

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

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
33
<phar name="php-cs-fixer" version="^3.75.0" installed="3.75.0" location="./tools/php-cs-fixer" copy="false"/>
4-
<phar name="phpcs" version="^3.12.1" installed="3.12.1" location="./tools/phpcs" copy="false"/>
5-
<phar name="phpcbf" version="^3.12.1" installed="3.12.1" location="./tools/phpcbf" copy="false"/>
4+
<phar name="phpcs" version="^4.0.0" installed="4.0.0" location="./tools/phpcs" copy="false"/>
5+
<phar name="phpcbf" version="^4.0.0" installed="4.0.0" location="./tools/phpcbf" copy="false"/>
66
<phar name="phpstan" version="^2.1.11" installed="2.1.11" location="./tools/phpstan" copy="false"/>
77
<phar name="composer-normalize" version="^2.46.0" installed="2.46.0" location="./tools/composer-normalize" copy="false"/>
88
</phive>

.php-cs-fixer.dist.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
'@PHP81Migration' => true,
1919
'@PHP80Migration:risky' => true,
2020
// symfony
21+
'array_indentation' => true,
2122
'class_attributes_separation' => true,
2223
'whitespace_after_comma_in_array' => true,
2324
'no_empty_statement' => true,
2425
'no_extra_blank_lines' => true,
2526
'type_declaration_spaces' => true,
26-
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']],
27+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'parameters']],
2728
'no_blank_lines_after_phpdoc' => true,
2829
'object_operator_without_whitespace' => true,
2930
'binary_operator_spaces' => true,
@@ -37,6 +38,7 @@
3738
'concat_space' => ['spacing' => 'one'],
3839
'linebreak_after_opening_tag' => true,
3940
'fully_qualified_strict_types' => true,
41+
'global_namespace_import' => ['import_classes' => true],
4042
// symfony:risky
4143
'no_alias_functions' => true,
4244
'self_accessor' => true,
@@ -48,6 +50,6 @@
4850
PhpCsFixer\Finder::create()
4951
->in(__DIR__)
5052
->append([__FILE__])
51-
->exclude(['vendor', 'tools', 'build']),
53+
->exclude(['tools', 'vendor', 'build'])
5254
)
5355
;

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr
99
Pueden aparecer cambios no liberados que se integran a la rama principal, pero no ameritan una nueva liberación de
1010
versión, aunque sí su incorporación en la rama principal de trabajo. Generalmente, se tratan de cambios en el desarrollo.
1111

12+
### Mantenimiento 2025-09-25
13+
14+
- Se actualizan las herramientas `phpcs` y `phpcbf` a la versión 4.0.0.
15+
- Se elimina la regla `Generic.Functions.CallTimePassByReference`.
16+
- Se moderniza la integración con SonarQube-Cloud.
17+
- Se actualiza `sonarqube-scan-action` a la versión 6.
18+
1219
## Listado de cambios
1320

1421
### Versión 1.3.0 2025-04-12

phpcs.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ruleset name="EngineWorks">
3-
<description>The EngineWorks (PSR-2 based) coding standard.</description>
3+
<description>The EngineWorks (PSR-12 based) coding standard.</description>
44

55
<file>src</file>
66
<file>tests</file>
@@ -18,7 +18,6 @@
1818
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
1919
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
2020
<rule ref="Generic.Formatting.SpaceAfterNot"/>
21-
<rule ref="Generic.Functions.CallTimePassByReference"/>
2221
<rule ref="Generic.NamingConventions.ConstructorName"/>
2322
<rule ref="Generic.PHP.DeprecatedFunctions"/>
2423
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>

src/Internal/BaseConverterSequence.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
namespace PhpCfdi\Credentials\Internal;
66

7+
use Stringable;
78
use UnexpectedValueException;
89

910
/** @internal */
10-
class BaseConverterSequence implements \Stringable
11+
class BaseConverterSequence implements Stringable
1112
{
1213
private readonly string $sequence;
1314

tests/Unit/SerialNumberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testSerialNumbersNotIssuedFromSat(
8383
string $hexadecimalInput,
8484
string $expectedDecimal,
8585
string $expectedBytes,
86-
bool $expectedBytesArePrintable
86+
bool $expectedBytesArePrintable,
8787
): void {
8888
$serial = SerialNumber::createFromHexadecimal($hexadecimalInput);
8989
$this->assertSame($expectedDecimal, $serial->decimal());

0 commit comments

Comments
 (0)