Skip to content

Commit bb4eb9c

Browse files
committed
Initial commit
0 parents  commit bb4eb9c

32 files changed

Lines changed: 2526 additions & 0 deletions

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.github export-ignore
2+
/tests export-ignore
3+
/.editorconfig export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.dist.php export-ignore
7+
/phpstan.dist.neon export-ignore
8+
/phpstan-baseline.neon export-ignore
9+
/phpunit.dist.xml export-ignore
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ '*.x' ]
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '0 8 * * *'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
PHP_VERSION: '8.5'
17+
18+
jobs:
19+
composer:
20+
runs-on: ubuntu-latest
21+
name: Composer Validations
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v7
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ env.PHP_VERSION }}
30+
coverage: none
31+
32+
- name: Validate composer.json
33+
run: composer validate --strict
34+
35+
- name: Check for PSR Violations
36+
run: composer dump --optimize --strict-psr
37+
38+
php-cs-fixer:
39+
runs-on: ubuntu-latest
40+
name: Coding Standards
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v7
44+
45+
- name: Setup PHP
46+
uses: shivammathur/setup-php@v2
47+
with:
48+
php-version: ${{ env.PHP_VERSION }}
49+
coverage: none
50+
tools: php-cs-fixer, cs2pr
51+
52+
- name: PHP Coding Standards Fixer
53+
run: php-cs-fixer fix --dry-run --format checkstyle | cs2pr
54+
55+
phpstan:
56+
runs-on: ubuntu-latest
57+
name: Static Analysis
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v7
61+
62+
- name: Setup PHP
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: ${{ env.PHP_VERSION }}
66+
coverage: none
67+
tools: phpstan
68+
69+
- name: Install Dependencies
70+
uses: ramsey/composer-install@v3
71+
with:
72+
composer-options: '--prefer-dist'
73+
74+
- name: Run PHPStan
75+
run: phpstan analyse --no-progress

.github/workflows/tests.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ '*.x' ]
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '0 8 * * *'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
phpunit:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
22+
symfony: [ '6.4', '7.4', '8.0', '8.1' ]
23+
dependencies: [ 'highest', 'lowest' ]
24+
exclude:
25+
- php: '8.1'
26+
symfony: '7.4'
27+
- php: '8.1'
28+
symfony: '8.0'
29+
- php: '8.2'
30+
symfony: '8.0'
31+
- php: '8.3'
32+
symfony: '8.0'
33+
- php: '8.1'
34+
symfony: '8.1'
35+
- php: '8.2'
36+
symfony: '8.1'
37+
- php: '8.3'
38+
symfony: '8.1'
39+
env:
40+
SYMFONY_REQUIRE: ${{ matrix.symfony }}.*
41+
name: PHP ${{ matrix.php }} & Symfony ${{ matrix.symfony }}${{ matrix.dependencies == 'lowest' && ' (lowest)' || '' }} Test
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v7
45+
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: ${{ matrix.php }}
50+
ini-values: zend.exception_ignore_args=false
51+
tools: flex
52+
53+
- name: Downgrade PHPUnit for PHP 8.1
54+
if: matrix.php == '8.1'
55+
run: |
56+
composer require --dev --no-update phpunit/phpunit:^10.5
57+
sed -i 's/failOnPhpunitDeprecation="true"//g' phpunit.dist.xml
58+
sed -i 's/failOnPhpunitNotice="true"//g' phpunit.dist.xml
59+
60+
- name: Downgrade PHPUnit for PHP 8.2
61+
if: matrix.php == '8.2'
62+
run: |
63+
composer require --dev --no-update phpunit/phpunit:^11.5
64+
sed -i 's/failOnPhpunitNotice="true"//g' phpunit.dist.xml
65+
66+
- name: Install Dependencies
67+
uses: ramsey/composer-install@v3
68+
with:
69+
composer-options: '--prefer-dist'
70+
dependency-versions: ${{ matrix.dependencies }}
71+
72+
- name: Run Tests
73+
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
74+
75+
- name: Upload Coverage to Codecov
76+
if: ${{ success() }}
77+
uses: codecov/codecov-action@v7
78+
with:
79+
files: coverage.xml
80+
flags: ${{ matrix.php }}
81+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Composer
2+
composer.lock
3+
vendor/
4+
5+
# PHP Coding Standards Fixer
6+
.php-cs-fixer.cache
7+
.php-cs-fixer.php
8+
9+
# PHPUnit
10+
.phpunit.cache
11+
phpunit.xml
12+
13+
# PHPStan
14+
phpstan.neon

.php-cs-fixer.dist.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->in(__DIR__)
7+
->append([__FILE__])
8+
;
9+
10+
return (new PhpCsFixer\Config())
11+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
12+
->setUsingCache(true)
13+
->setRules([
14+
'@PHP8x1Migration' => true,
15+
'@PHPUnit11x0Migration:risky' => true,
16+
'@Symfony' => true,
17+
'@Symfony:risky' => true,
18+
'attribute_empty_parentheses' => true,
19+
'declare_strict_types' => true,
20+
'heredoc_to_nowdoc' => true,
21+
'no_superfluous_phpdoc_tags' => true,
22+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
23+
'self_static_accessor' => true,
24+
'single_line_throw' => false,
25+
'trailing_comma_in_multiline' => [
26+
'after_heredoc' => true,
27+
'elements' => ['arguments', 'array_destructuring', 'arrays', 'match', 'parameters'],
28+
],
29+
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
30+
])
31+
->setRiskyAllowed(true)
32+
->setFinder($finder)
33+
;

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 HypeMC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)