Skip to content

Commit f0265c9

Browse files
authored
Merge pull request #23 from eclipxe13/version-3.2.1
Corregir el proceso de construcción (versión 3.2.1)
2 parents 4f816c7 + f3805bc commit f0265c9

File tree

8 files changed

+48
-20
lines changed

8 files changed

+48
-20
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup PHP
2222
uses: shivammathur/setup-php@v2
2323
with:
24-
php-version: '8.3'
24+
php-version: '8.4'
2525
coverage: none
2626
tools: phpcs, cs2pr
2727
- name: phpcs
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup PHP
5252
uses: shivammathur/setup-php@v2
5353
with:
54-
php-version: '8.3'
54+
php-version: '8.4'
5555
coverage: none
5656
tools: composer:v2, phpstan, cs2pr
5757
- name: Get composer cache directory
@@ -77,7 +77,7 @@ jobs:
7777
- name: Setup PHP
7878
uses: shivammathur/setup-php@v2
7979
with:
80-
php-version: '8.3'
80+
php-version: '8.4'
8181
coverage: none
8282
tools: psalm, cs2pr
8383
- name: Get composer cache directory
@@ -99,7 +99,7 @@ jobs:
9999
runs-on: "ubuntu-latest"
100100
strategy:
101101
matrix:
102-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
102+
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
103103
steps:
104104
- name: Checkout
105105
uses: actions/checkout@v4
@@ -134,7 +134,7 @@ jobs:
134134
- name: Setup PHP
135135
uses: shivammathur/setup-php@v2
136136
with:
137-
php-version: '8.3'
137+
php-version: '8.4'
138138
coverage: xdebug
139139
tools: composer:v2, infection
140140
- name: Get composer cache directory

.github/workflows/sonarcloud.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
# Actions
88
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action
9-
# sonarsource/sonarcloud-github-action@master https://github.com/marketplace/actions/sonarcloud-scan
9+
# SonarSource/sonarqube-scan-action@v5 https://github.com/marketplace/actions/official-sonarqube-scan
1010

1111
jobs:
1212

@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.3'
22+
php-version: '8.4'
2323
coverage: xdebug
2424
tools: composer:v2
2525
env:
@@ -79,7 +79,7 @@ jobs:
7979
- name: Setup PHP
8080
uses: shivammathur/setup-php@v2
8181
with:
82-
php-version: '8.3'
82+
php-version: '8.4'
8383
coverage: none
8484
tools: composer:v2
8585
- name: Get composer cache directory
@@ -103,7 +103,6 @@ jobs:
103103
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/junit.xml > build/sonar-junit.xml
104104
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/clover.xml > build/sonar-coverage.xml
105105
- name: SonarCloud Scan
106-
uses: sonarsource/sonarcloud-github-action@master
106+
uses: SonarSource/sonarqube-scan-action@v5
107107
env:
108-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109108
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.phive/phars.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.64.0" installed="3.64.0" location="./tools/php-cs-fixer" copy="false"/>
4-
<phar name="phpcs" version="^3.10.2" installed="3.10.2" location="./tools/phpcs" copy="false"/>
5-
<phar name="phpcbf" version="^3.10.2" installed="3.10.2" location="./tools/phpcbf" copy="false"/>
6-
<phar name="phpstan" version="^1.12.3" installed="1.12.3" location="./tools/phpstan" copy="false"/>
7-
<phar name="psalm" version="^5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
8-
<phar name="infection" version="^0.29.6" installed="0.29.6" location="./tools/infection" copy="false"/>
3+
<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.2" installed="3.12.2" location="./tools/phpcs" copy="false"/>
5+
<phar name="phpcbf" version="^3.12.2" installed="3.12.2" location="./tools/phpcbf" copy="false"/>
6+
<phar name="phpstan" version="^2.1.11" installed="2.1.11" location="./tools/phpstan" copy="false"/>
7+
<phar name="psalm" version="^6.10.0" installed="6.10.0" location="./tools/psalm" copy="false"/>
8+
<phar name="infection" version="^0.29.14" installed="0.29.14" location="./tools/infection" copy="false"/>
99
</phive>

docs/CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ 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+
## Listado de cambios
13+
14+
### Version 3.2.1 2025-04-13
15+
16+
- Se comprueba que el proyecto es compatible con PHP 8.4.
17+
- Se genera una excepción lógica cuando el método `DOMHelper#getAttribute()` es llamado sin argumentos.
18+
19+
Los siguientes cambios aplican al entorno de desarrollo.
20+
21+
- Se agrega PHP 8.4 a la matriz de pruebas.
22+
- Se ejecutan los flujos de trabajo con PHP 8.4.
23+
- Se actualizan las herramientas de desarrollo.
24+
- Se actualizó la herramienta para ejecutar *Sonarqube* en el flujo de trabajo *sonarcloud*.
25+
1226
### Mantenimiento 2024-09-09
1327

1428
- Se remueven los paréntesis innecesarios de las llamadas `return`.
@@ -42,8 +56,6 @@ versión, aunque sí su incorporación en la rama principal de trabajo, generalm
4256
- Se cambian los badges en el archivo `README`.
4357
- Se corrigen las clases en las pruebas para que tengan alguno de los modificadores `final` o `abstract`.
4458

45-
## Listado de cambios
46-
4759
### Version 3.2.0 2022-06-27
4860

4961
#### Soporte de RET 2.0

psalm.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0"?>
22
<psalm xmlns="https://getpsalm.org/schema/config"
3-
resolveFromConfigFile="true"
43
errorLevel="1">
54
<projectFiles>
65
<directory name="src" />
@@ -10,6 +9,10 @@
109
</projectFiles>
1110

1211
<issueHandlers>
12+
<PossiblyUnusedMethod errorLevel="info" />
13+
<UnusedClass errorLevel="info" />
14+
<ClassMustBeFinal errorLevel="info" />
15+
<MissingOverrideAttribute errorLevel="info" />
1316
<LessSpecificReturnType errorLevel="info" />
1417
</issueHandlers>
1518
</psalm>

src/Extractors/Standards/FormatSelloLast8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ trait FormatSelloLast8
88
{
99
public function formatSello(string $sello): string
1010
{
11-
return substr($sello, -8);
11+
return (string) substr($sello, -8);
1212
}
1313
}

src/Internal/DOMHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public function rootElement(): DOMElement
3434

3535
public function getAttribute(string ...$path): string
3636
{
37+
if ([] === $path) {
38+
throw new LogicException('Attrribute path cannot be empty');
39+
}
3740
$value = $this->findAttribute(...$path);
3841
if (null === $value) {
3942
$attribute = array_pop($path);

tests/Unit/Internal/DOMHelperTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,15 @@ public function testGetAttributeInDepth(): void
162162
$attribute = $helper->getAttribute('b:books', 'b:library', 't:topic', 'b:book', 'author');
163163
$this->assertSame('Carlos C Soto', $attribute);
164164
}
165+
166+
public function testGetAttributeWithNoArguments(): void
167+
{
168+
$document = new DOMDocument();
169+
$helper = new DOMHelper($document);
170+
$document->load($this->filePath('books.xml'));
171+
172+
$this->expectException(LogicException::class);
173+
$this->expectExceptionMessage('Attrribute path cannot be empty');
174+
$helper->getAttribute();
175+
}
165176
}

0 commit comments

Comments
 (0)