Skip to content

Commit

Permalink
Merge pull request #24 from eclipxe13/version-2
Browse files Browse the repository at this point in the history
Refactorización del proyecto (version 2)
  • Loading branch information
eclipxe13 authored Mar 7, 2024
2 parents 46bd2da + 8596cf9 commit c2146e0
Show file tree
Hide file tree
Showing 57 changed files with 1,834 additions and 535 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
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
41 changes: 22 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ on:
jobs:

phpcs:
name: Code style (phpcs)
name: Coding standards (phpcs)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: cs2pr, phpcs
env:
Expand All @@ -31,34 +31,33 @@ jobs:
run: phpcs -q --report=checkstyle | cs2pr

php-cs-fixer:
name: Code style (php-cs-fixer)
name: Coding standards (php-cs-fixer)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
coverage: none
tools: cs2pr, php-cs-fixer
env:
fail-fast: true
- name: Code style (php-cs-fixer)
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
env:
PHP_CS_FIXER_IGNORE_ENV: 1

phpstan:
name: Code analysis (phpstan)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: soap
coverage: none
tools: composer:v2, phpstan
env:
Expand All @@ -67,7 +66,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -82,11 +81,12 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: soap
coverage: none
tools: composer:v2, psalm
env:
Expand All @@ -95,29 +95,32 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Psalm version
run: psalm --version
- name: Psalm
run: psalm --no-progress
run: psalm --no-progress --output-format=checkstyle

tests:
name: Tests on PHP ${{ matrix.php-versions }}
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: soap
coverage: none
tools: composer:v2
env:
Expand All @@ -126,12 +129,12 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Tests (phpunit)
run: vendor/bin/phpunit --testdox --verbose
run: vendor/bin/phpunit --testdox
30 changes: 16 additions & 14 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ on:
jobs:

tests-coverage:
name: Tests on PHP 8.0 (code coverage)
name: Create code coverage
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: soap
coverage: xdebug
tools: composer:v2
env:
Expand All @@ -28,17 +29,17 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Create code coverage
run: vendor/bin/phpunit --testdox --verbose --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
run: vendor/bin/phpunit --testdox --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
- name: Store code coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: build/coverage
Expand All @@ -49,11 +50,12 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: soap
coverage: none
tools: composer:v2,infection
env:
Expand All @@ -62,15 +64,15 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Obtain code coverage
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: code-coverage
path: build/coverage
Expand Down Expand Up @@ -107,28 +109,28 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Unshallow clone to provide blame information
run: git fetch --unshallow
- 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
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Obtain code coverage
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: code-coverage
path: build/coverage
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.14.4" installed="3.14.4" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.7.2" installed="3.7.2" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.7.2" installed="3.7.2" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^1.10.3" installed="1.10.3" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^4.30.0" installed="4.30.0" location="./tools/psalm" copy="false"/>
<phar name="infection" version="^0.26.19" installed="0.26.19" location="./tools/infection" copy="false"/>
<phar name="php-cs-fixer" version="^3.51.0" installed="3.51.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.9.0" installed="3.9.0" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.9.0" installed="3.9.0" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^1.10.60" installed="1.10.60" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^5.22.2" installed="5.22.2" location="./tools/psalm" copy="false"/>
<phar name="infection" version="^0.27.10" installed="0.27.10" location="./tools/infection" copy="false"/>
</phive>
4 changes: 2 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
'whitespace_after_comma_in_array' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'function_typehint_space' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']],
'type_declaration_spaces' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'match', 'arguments', 'parameters']],
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => true,
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 - 2023 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
Loading

0 comments on commit c2146e0

Please sign in to comment.