Skip to content

Commit b751a0d

Browse files
authored
Merge pull request #7 from eclipxe13/version-3.0.3
Compatibilidad con PHP 8.4 y mantenimiento (version 3.0.3)
2 parents 8501b2f + 91db020 commit b751a0d

21 files changed

+169
-227
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
9+
[**.{yml,yml.dist,neon,neon.dist}]
10+
indent_size = 2
11+
12+
[**.{php,xml,yml,json,dist}]
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
16+
17+
[**.md]
18+
charset = utf-8
19+
trim_trailing_whitespace = false
20+
insert_final_newline = true

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/.phive/ export-ignore
1212
/build/ export-ignore
1313
/tests/ export-ignore
14+
/.editorconfig export-ignore
1415
/.dockerignore export-ignore
1516
/.gitattributes export-ignore
1617
/.gitignore export-ignore
@@ -19,7 +20,6 @@
1920
/phpcs.xml.dist export-ignore
2021
/phpstan.neon.dist export-ignore
2122
/phpunit.xml.dist export-ignore
22-
/psalm.xml.dist export-ignore
2323
/sonar-project.properties export-ignore
2424

2525
# Do not count these files on github code language

.github/workflows/build.yml

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ jobs:
2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2
2424
with:
25-
php-version: '8.3'
25+
php-version: '8.4'
2626
coverage: none
2727
tools: composer-normalize
2828
env:
2929
fail-fast: true
3030
- name: Composer normalize
31-
run: composer-normalize
31+
run: composer-normalize --dry-run
3232

3333
phpcs:
34-
name: Code style (phpcs)
34+
name: Coding standards (phpcs)
3535
runs-on: "ubuntu-latest"
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v4
3939
- name: Setup PHP
4040
uses: shivammathur/setup-php@v2
4141
with:
42-
php-version: '8.3'
42+
php-version: '8.4'
4343
coverage: none
4444
tools: cs2pr, phpcs
4545
env:
@@ -48,15 +48,15 @@ jobs:
4848
run: phpcs -q --report=checkstyle | cs2pr
4949

5050
php-cs-fixer:
51-
name: Code style (php-cs-fixer)
51+
name: Coding standards (php-cs-fixer)
5252
runs-on: "ubuntu-latest"
5353
steps:
5454
- name: Checkout
5555
uses: actions/checkout@v4
5656
- name: Setup PHP
5757
uses: shivammathur/setup-php@v2
5858
with:
59-
php-version: '8.3'
59+
php-version: '8.4'
6060
coverage: none
6161
tools: cs2pr, php-cs-fixer
6262
env:
@@ -73,14 +73,14 @@ jobs:
7373
- name: Setup PHP
7474
uses: shivammathur/setup-php@v2
7575
with:
76-
php-version: '8.3'
76+
php-version: '8.4'
7777
coverage: none
78-
tools: composer:v2, cs2pr, phpstan
78+
tools: composer:v2, phpstan
7979
env:
8080
fail-fast: true
8181
- name: Get composer cache directory
8282
id: composer-cache
83-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
83+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8484
- name: Cache dependencies
8585
uses: actions/cache@v4
8686
with:
@@ -90,44 +90,14 @@ jobs:
9090
- name: Install project dependencies
9191
run: composer upgrade --no-interaction --no-progress --prefer-dist
9292
- name: PHPStan
93-
run: phpstan analyse --no-progress
94-
95-
psalm:
96-
name: Code analysis (psalm)
97-
runs-on: "ubuntu-latest"
98-
steps:
99-
- name: Checkout
100-
uses: actions/checkout@v4
101-
- name: Setup PHP
102-
uses: shivammathur/setup-php@v2
103-
with:
104-
php-version: '8.3'
105-
coverage: none
106-
tools: composer:v2, cs2pr, psalm
107-
env:
108-
fail-fast: true
109-
- name: Get composer cache directory
110-
id: composer-cache
111-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
112-
- name: Cache dependencies
113-
uses: actions/cache@v4
114-
with:
115-
path: ${{ steps.composer-cache.outputs.dir }}
116-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
117-
restore-keys: ${{ runner.os }}-composer-
118-
- name: Install project dependencies
119-
run: composer upgrade --no-interaction --no-progress --prefer-dist
120-
- name: Psalm version
121-
run: psalm --version
122-
- name: Psalm
123-
run: psalm --no-progress --output-format=github
93+
run: phpstan analyse --no-progress --verbose
12494

12595
tests:
12696
name: Tests on PHP ${{ matrix.php-version }}
12797
runs-on: "ubuntu-latest"
12898
strategy:
12999
matrix:
130-
php-version: ['8.3']
100+
php-version: ['8.3', '8.4']
131101
steps:
132102
- name: Checkout
133103
uses: actions/checkout@v4
@@ -141,7 +111,7 @@ jobs:
141111
fail-fast: true
142112
- name: Get composer cache directory
143113
id: composer-cache
144-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
114+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
145115
- name: Cache dependencies
146116
uses: actions/cache@v4
147117
with:

.github/workflows/sonarcloud.yml

Lines changed: 0 additions & 109 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@v6 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@v6
52+
env:
53+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# do not include this files on git
2-
/tools
3-
/vendor
2+
/tools/
3+
/vendor/
44
/composer.lock

.phive/phars.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpcs" version="^3.9.2" installed="3.9.2" location="./tools/phpcs" copy="false"/>
4-
<phar name="phpcbf" version="^3.9.2" installed="3.9.2" location="./tools/phpcbf" copy="false"/>
5-
<phar name="php-cs-fixer" version="^3.57.1" installed="3.57.1" location="./tools/php-cs-fixer" copy="false"/>
6-
<phar name="phpstan" version="^1.11.1" installed="1.11.1" location="./tools/phpstan" copy="false"/>
7-
<phar name="psalm" version="^5.24.0" installed="5.24.0" location="./tools/psalm" copy="false"/>
8-
<phar name="composer-normalize" version="^2.42.0" installed="2.42.0" location="./tools/composer-normalize" copy="false"/>
3+
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
4+
<phar name="php-cs-fixer" version="^3.89.2" installed="3.89.2" location="./tools/php-cs-fixer" copy="false"/>
5+
<phar name="phpcs" version="^4.0.1" installed="4.0.1" location="./tools/phpcs" copy="false"/>
6+
<phar name="phpcbf" version="^4.0.1" installed="4.0.1" location="./tools/phpcbf" copy="false"/>
7+
<phar name="phpstan" version="^2.1.32" nstalled="2.1.32" location="./tools/phpstan" copy="false" installed="2.1.32"/>
98
</phive>

.php-cs-fixer.dist.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
->setRules([
1616
'@PSR12' => true,
1717
'@PSR12:risky' => true,
18-
'@PHP80Migration:risky' => true,
19-
'@PHP80Migration' => true,
18+
'@PHP8x3Migration' => true,
19+
'@PHP8x2Migration: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', 'arguments']],
27+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'arguments', '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,

0 commit comments

Comments
 (0)