Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 14 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md,json}]
indent_style = space
indent_size = 4
indent_style = space

[*.md]
indent_size = 2
tab_width = 2
trim_trailing_whitespace = false

[*.json]
indent_size = 2
tab_width = 2

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

[*.php]
indent_style = space
indent_size = 4
max_line_length = 120
150 changes: 114 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,142 @@ name: Continuous Integration

on:
push:
branches: [main]
branches:
- main
paths-ignore:
- "**.md"
- "renovate.json"
- ".github/ISSUE_TEMPLATE/**"
- ".github/workflows/release.yml"

pull_request:
paths-ignore:
- "**.md"
- "renovate.json"
- ".github/ISSUE_TEMPLATE/**"
- ".github/workflows/release.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
static-analysis:
coding-standards:
name: Coding Standards
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
show-progress: false
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1

- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '8.4'
php-version: 'latest'
tools: composer
extensions: xdebug
- uses: actions/cache@v4
coverage: none

- name: Composer Install
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Check Syntax
run: composer dev:lint:syntax

- name: Check Code Style
run: composer dev:lint:style

static-analysis:
name: Static Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
path: |
vendor
~/.composer/cache
key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-${{ runner.os }}-
- run: composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
- run: composer normalize --dry-run
- run: composer validate
- run: composer phpstan -- --ansi
- run: composer psalm
fetch-depth: 0
show-progress: false

unit-tests:
needs: [static-analysis]
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: 'latest'
tools: composer
coverage: none

- name: Composer Install
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Run Static Analysis
run: composer dev:analyze:phpstan

code-coverage:
name: Code Coverage
needs: [coding-standards, static-analysis]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
show-progress: false
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1

- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '8.4'
php-version: 'latest'
tools: composer
extensions: gmp
coverage: xdebug
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-${{ runner.os }}-
- run: composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
- run: composer normalize --dry-run
- run: composer validate
- run: vendor/bin/phpunit || true
- uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9

- name: Composer Install
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Run Tests with Coverage
run: composer dev:test:coverage:ci

- name: Upload to SonarCloud
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # 7.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

unit-tests:
name: Unit Tests
needs: [coding-standards, static-analysis]
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
os: [ubuntu-latest, windows-latest]

steps:
- name: Configure Git for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
git config --system core.autocrlf false
git config --system core.eol lf

- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
show-progress: false

- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: gmp
coverage: none

- name: Composer Install
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Run Unit Tests
run: composer dev:test:unit
132 changes: 127 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,131 @@
# PhpStorm
/.idea/
##### Operating Systems

# Composer
/vendor
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.lnk

##### IDEs and Editors

# JetBrains (PhpStorm, IntelliJ, etc.)
.idea/
*.iws
out/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
.history/

# Vim
[._]*.s[a-v][a-z]
!*.svg
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
.netrwhist
tags
[._]*.un~

# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
.org-id-locations
*_archive

# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
sftp-config.json
sftp-config-alt*.json

##### Backup Files
*.bak
*.gho
*.ori
*.orig
*.tmp

##### Composer
composer.phar
/vendor/
composer.lock

##### PHP Testing & Analysis
# PHPUnit
/.phpunit.cache
.phpunit.cache/
.phpunit.result.cache
phpunit.xml

# Coverage Reports
coverage/
build/
*.coverage
clover.xml
coverage.xml
coverage.clover
phpunit-coverage.xml

# PHPStan
.phpstan.cache/
.phpstan/
phpstan.neon.dist

# PHP-CS-Fixer / CodeSniffer
.php-cs-fixer.cache
.php_cs.cache
/wpcs/*

# Psalm
.psalm/
psalm.xml
Loading