Skip to content

Commit

Permalink
Merge pull request #28 from eclipxe13/fix-build
Browse files Browse the repository at this point in the history
Corrección de build (fix phpstan issues) y mantenimiento [v0.4.2]
  • Loading branch information
eclipxe13 authored May 30, 2022
2 parents c1247a3 + b9d7eeb commit fd42908
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2 # see https://github.com/marketplace/actions/setup-php-action
with:
php-version: '8.0'
php-version: '8.1'
coverage: none
tools: composer:v2, cs2pr, phpcs
env:
fail-fast: true
- name: Code style (phpcs)
run: phpcs -q --report=checkstyle src/ tests/ | cs2pr
run: phpcs -q --report=checkstyle | cs2pr

php-cs-fixer:
name: Code style (php-cs-fixer)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2 # see https://github.com/marketplace/actions/setup-php-action
with:
php-version: '8.0'
php-version: '8.1'
coverage: none
tools: composer:v2, cs2pr, php-cs-fixer
env:
Expand All @@ -48,11 +48,11 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2 # see https://github.com/marketplace/actions/setup-php-action
with:
php-version: '8.0'
php-version: '8.1'
coverage: none
tools: composer:v2, cs2pr, phpstan
extensions: soap
Expand All @@ -62,7 +62,7 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -77,10 +77,10 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
php-versions: ['7.3', '7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2 # see https://github.com/marketplace/actions/setup-php-action
with:
Expand All @@ -94,7 +94,7 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# see https://github.com/marketplace/actions/setup-php-action
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
php-version: '8.1'
extensions: soap
coverage: xdebug
tools: composer:v2
Expand All @@ -31,7 +31,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<phive xmlns="https://phar.io/phive">
<phar name="phpcs" version="^3.6.2" installed="3.6.2" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.6.2" installed="3.6.2" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.4.0" installed="3.4.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.3.3" installed="1.3.3" location="./tools/phpstan" copy="false"/>
<phar name="php-cs-fixer" version="^3.8.0" installed="3.8.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.7.5" installed="1.7.5" location="./tools/phpstan" copy="false"/>
</phive>
12 changes: 12 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

Nos apegamos a [SEMVER](SEMVER.md), revisa la información para entender mejor el control de versiones.

## Version 0.4.2 2022-05-30

Se hacen cambios menores y de mantenimiento:

- Se corrige `Finkok::checkCommand` pues podría llamar a la función `is_a` con un parámetro que no es un objeto.
- Se actualizan las versiones de herramientas de desarrollo `phpstan` y `php-cs-fixer`.
- Correcciones al proceso de integración continua `build`:
- Los trabajos se ejecutan en PHP 8.1.
- Se agrega PHP 8.1 a la matriz de pruebas.
- `phpcs` usa los directorios configurados en `phpcs.xml.dist`.
- Las acciones de github se actualizan a la versión 3.

## Version 0.4.1 2022-01-11

Se hacen cambios menores y de mantenimiento:
Expand Down
5 changes: 2 additions & 3 deletions src/Finkok.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
class Finkok
{
/** @var array<string, string[]> */
/** @var array<string, array{0: class-string, 1: class-string, 2?: string}> */
protected const SERVICES_MAP = [
'stamp' => [Stamping\StampService::class, Stamping\StampingCommand::class],
'quickstamp' => [Stamping\QuickStampService::class, Stamping\StampingCommand::class],
Expand Down Expand Up @@ -125,8 +125,7 @@ protected function checkCommand(string $method, $command): ?object
if ('' === $expected) {
return null;
}
/** @var object|string $command */
if (! is_a($command, $expected)) {
if (! is_object($command) || ! is_a($command, $expected)) {
$type = (is_object($command)) ? get_class($command) : gettype($command);
throw new InvalidArgumentException(
sprintf('Call %s::%s expect %s but received %s', static::class, $method, $expected, $type)
Expand Down

0 comments on commit fd42908

Please sign in to comment.