Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf

[**.{yml,yml.dist,neon,neon.dist}]
indent_size = 2

[**.{php,xml,yml,json,dist}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[**.md]
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/.phive/ export-ignore
/build/ export-ignore
/tests/ export-ignore
/.editorconfig export-ignore
/.dockerignore export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
Expand All @@ -19,7 +20,6 @@
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
/sonar-project.properties export-ignore

# Do not count these files on github code language
Expand Down
54 changes: 12 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: composer-normalize
env:
fail-fast: true
- name: Composer normalize
run: composer-normalize
run: composer-normalize --dry-run

phpcs:
name: Code style (phpcs)
name: Coding standards (phpcs)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: cs2pr, phpcs
env:
Expand All @@ -48,15 +48,15 @@ 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@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: cs2pr, php-cs-fixer
env:
Expand All @@ -73,14 +73,14 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: composer:v2, cs2pr, phpstan
tools: composer:v2, phpstan
env:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
Expand All @@ -90,44 +90,14 @@ jobs:
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: PHPStan
run: phpstan analyse --no-progress

psalm:
name: Code analysis (psalm)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: composer:v2, cs2pr, psalm
env:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
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 --output-format=github
run: phpstan analyse --no-progress --verbose

tests:
name: Tests on PHP ${{ matrix.php-version }}
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version: ['8.3']
php-version: ['8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -141,7 +111,7 @@ jobs:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
Expand Down
109 changes: 0 additions & 109 deletions .github/workflows/sonarcloud.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/sonarqube-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "SonarQube Cloud"
on:
workflow_dispatch:
push:
branches: [ "main" ]

# Actions
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action
# SonarSource/sonarqube-scan-action@v6 https://github.com/marketplace/actions/official-sonarqube-scan

jobs:

sonarqube-cloud:
name: SonarCloud Scan and Report
runs-on: "ubuntu-latest"
steps:
- name: Check SONAR_TOKEN secret
run: |
if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then
echo "::warning ::SONAR_TOKEN non set"
exit 1
fi
- name: Checkout
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.4'
coverage: xdebug
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@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 --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
- name: Prepare SonarCloud Code Coverage Files
run: |
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/junit.xml > build/sonar-junit.xml
sed 's#'$GITHUB_WORKSPACE'#/github/workspace#g' build/coverage/clover.xml > build/sonar-coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# do not include this files on git
/tools
/vendor
/tools/
/vendor/
/composer.lock
11 changes: 5 additions & 6 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcs" version="^3.9.2" installed="3.9.2" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.9.2" installed="3.9.2" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.57.1" installed="3.57.1" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.11.1" installed="1.11.1" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^5.24.0" installed="5.24.0" location="./tools/psalm" copy="false"/>
<phar name="composer-normalize" version="^2.42.0" installed="2.42.0" location="./tools/composer-normalize" copy="false"/>
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
<phar name="php-cs-fixer" version="^3.89.2" installed="3.89.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^4.0.1" installed="4.0.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^4.0.1" installed="4.0.1" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^2.1.32" nstalled="2.1.32" location="./tools/phpstan" copy="false" installed="2.1.32"/>
</phive>
8 changes: 5 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP80Migration' => true,
'@PHP8x3Migration' => true,
'@PHP8x2Migration:risky' => true,
// symfony
'array_indentation' => true,
'class_attributes_separation' => true,
'whitespace_after_comma_in_array' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'type_declaration_spaces' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'arguments']],
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'arguments', 'parameters']],
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => true,
Expand All @@ -37,6 +38,7 @@
'concat_space' => ['spacing' => 'one'],
'linebreak_after_opening_tag' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => ['import_classes' => true],
// symfony:risky
'no_alias_functions' => true,
'self_accessor' => true,
Expand Down
Loading