Skip to content

Commit

Permalink
Merge pull request #32 from eclipxe13/maintenance-20240122
Browse files Browse the repository at this point in the history
Corregir construcción del proyecto (mantenimiento 2024-01-22)
  • Loading branch information
eclipxe13 authored Jan 22, 2024
2 parents 13abae7 + 79cd2a2 commit 79a32da
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
/sonar-project.properties export-ignore

# Do not count these files on github code language
/tests/_files/** linguist-detectable=false
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: build
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
push:
Expand All @@ -21,7 +22,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: cs2pr, phpcs
env:
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: composer:v2, phpstan
env:
Expand Down Expand Up @@ -83,7 +84,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: composer:v2, psalm
env:
Expand All @@ -107,7 +108,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: coverage
on:
workflow_dispatch:
push:
branches: [ "main" ]

Expand All @@ -10,15 +11,15 @@ on:
jobs:

tests-coverage:
name: Tests on PHP 8.2 (code coverage)
name: Tests on PHP 8.3 (code coverage)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: xdebug
tools: composer:v2
env:
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: composer:v2, infection
env:
Expand Down Expand Up @@ -112,7 +113,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: composer:v2
- name: Get composer cache directory
Expand Down
12 changes: 6 additions & 6 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.13.0" installed="3.13.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.7.1" installed="3.7.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.7.1" installed="3.7.1" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^1.9.3" installed="1.9.3" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^5.2.0" installed="5.2.0" location="./tools/psalm" copy="false"/>
<phar name="infection" version="^0.26.16" installed="0.26.16" location="./tools/infection" copy="false"/>
<phar name="php-cs-fixer" version="^3.48.0" installed="3.48.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.8.1" installed="3.8.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.8.1" installed="3.8.1" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^1.10.56" installed="1.10.56" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^5.20.0" installed="5.20.0" location="./tools/psalm" copy="false"/>
<phar name="infection" version="^0.26.21" installed="0.26.21" location="./tools/infection" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'whitespace_after_comma_in_array' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'function_typehint_space' => true,
'type_declaration_spaces' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']],
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contribuciones

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

Este proyecto se apega al siguiente [Código de Conducta][coc].
Al participar en este proyecto y en su comunidad, deberás seguir este código.
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 - 2022 PhpCfdi https://www.phpcfdi.com/
Copyright (c) 2019 - 2024 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[badge-php-version]: https://img.shields.io/packagist/php-v/phpcfdi/xml-cancelacion?logo=php
[badge-release]: https://img.shields.io/github/release/phpcfdi/xml-cancelacion?logo=git
[badge-license]: https://img.shields.io/github/license/phpcfdi/xml-cancelacion?logo=open-source-initiative
[badge-build]: https://img.shields.io/github/workflow/status/phpcfdi/xml-cancelacion/build/main?logo=github-actions
[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/xml-cancelacion/build.yml?branch=main&logo=github-actions
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_xml-cancelacion&metric=reliability_rating
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_xml-cancelacion&metric=sqale_rating
[badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_xml-cancelacion/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
Expand Down
15 changes: 15 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr
Pueden aparecer cambios no liberados que se integran a la rama principal, pero no ameritan una nueva liberación de
versión, aunque sí su incorporación en la rama principal de trabajo. Generalmente, se tratan de cambios en el desarrollo.

### Mantenimiento 2024-01-22

- Se actualiza el año de la licencia.
- Se corrige el archivo de configuración de `php-cs-fixer`.
- Se corrige el código para solventar los problemas de `php-cs-fixer` y `psalm`.
No produjo cambios que requieran liberar una nueva versión.
- Se corrige el ancla del proyecto en el archivo `CONTRIBUTING.md`.
- Se corrige la insignia de construcción del proyecto en el archivo `README.md`.
- Se configura GitHub para ignorar la detección de lenguaje en la ruta `tests/_files/`.
- Se actualizan los flujos de trabajo de GitHub:
- Se agrega PHP 8.3 a la matriz de prebas en el trabajo `tests`.
- Los trabajos se ejecutan en PHP 8.3.
- Se permite ejecutar los trabajos manualmente.
- Se actualizan las herramientas de desarrollo.

## Listado de cambios

### Versión 2.0.2 2022-12-15
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset name="EngineWorks">
<description>The EngineWorks (PSR-2 based) coding standard.</description>
<description>The EngineWorks (PSR-12 based) coding standard.</description>

<file>src</file>
<file>tests</file>
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sonar.sourceEncoding=UTF-8
sonar.language=php
sonar.sources=src
sonar.tests=tests
sonar.exclusions=vendor/,tools/,build/,tests/_files/
sonar.test.exclusions=tests/_files/**/*
sonar.working.directory=build/.scannerwork
sonar.php.tests.reportPath=build/sonar-junit.xml
sonar.php.coverage.reportPaths=build/sonar-coverage.xml
5 changes: 2 additions & 3 deletions src/Capsules/ObtainRelated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use DOMDocument;
use PhpCfdi\XmlCancelacion\Internal\XmlHelperFunctions;
use PhpCfdi\XmlCancelacion\Models;
use PhpCfdi\XmlCancelacion\Models\DocumentType;
use PhpCfdi\XmlCancelacion\Models\RfcRole;

Expand All @@ -20,7 +19,7 @@ class ObtainRelated implements CapsuleInterface
/** @var string */
private $rfc;

/** @var Models\RfcRole */
/** @var RfcRole */
private $role;

/** @var string */
Expand All @@ -44,7 +43,7 @@ public function rfc(): string
return $this->rfc;
}

public function role(): Models\RfcRole
public function role(): RfcRole
{
return $this->role;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Signers/SignCapsuleMethodTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function signCapsule(CapsuleInterface $capsule, Credentials $credentials)
}
$document = $capsule->exportToDocument();
$this->signDocument($document, $credentials);
return $document->saveXML() ?: '';
return (string) $document->saveXML();

Check warning on line 20 in src/Signers/SignCapsuleMethodTrait.php

View workflow job for this annotation

GitHub Actions / Mutation testing analysis

Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ } $document = $capsule->exportToDocument(); $this->signDocument($document, $credentials); - return (string) $document->saveXML(); + return $document->saveXML(); } }
}
}

0 comments on commit 79a32da

Please sign in to comment.