Skip to content

Commit 79af51f

Browse files
Initial commit
0 parents  commit 79af51f

22 files changed

+1375
-0
lines changed

.github/workflows/cs.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
- pull_request
3+
- push
4+
5+
name: CS Check
6+
7+
jobs:
8+
tests:
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os:
14+
- ubuntu-latest
15+
php:
16+
- "8.2"
17+
steps:
18+
-
19+
name: Checkout
20+
uses: actions/checkout@v4
21+
22+
-
23+
name: Install PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
tools: composer:v2
28+
29+
-
30+
name: Determine composer cache directory
31+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
32+
33+
-
34+
name: Cache dependencies installed with composer
35+
uses: actions/cache@v4
36+
with:
37+
path: ${{ env.COMPOSER_CACHE_DIR }}
38+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: |
40+
php${{ matrix.php }}-composer-latest-
41+
-
42+
name: Update composer
43+
run: composer self-update
44+
45+
-
46+
name: Install dependencies with composer
47+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
48+
49+
-
50+
name: Run php-cs-fixer
51+
run: composer cs-check

.github/workflows/tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
- pull_request
3+
- push
4+
5+
name: Tests
6+
7+
jobs:
8+
tests:
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os:
14+
- ubuntu-latest
15+
php:
16+
- "8.2"
17+
- "8.3"
18+
steps:
19+
-
20+
name: Checkout
21+
uses: actions/checkout@v4
22+
23+
-
24+
name: Install PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: composer:v2
29+
30+
-
31+
name: Determine composer cache directory
32+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
33+
34+
-
35+
name: Cache dependencies installed with composer
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.COMPOSER_CACHE_DIR }}
39+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: |
41+
php${{ matrix.php }}-composer-{{ matrix.deps }}-
42+
-
43+
name: Update composer
44+
run: composer self-update
45+
46+
-
47+
name: Install dependencies with composer
48+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
49+
50+
-
51+
name: Run tests with phpunit
52+
run: composer test

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
build/
2+
vendor/
3+
4+
composer.lock
5+
*.cache
6+
7+
### JetBrains template
8+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
9+
10+
*.iml
11+
12+
## File-based project format:
13+
*.ipr
14+
*.iws
15+
16+
## Plugin-specific files:
17+
18+
# IntelliJ
19+
out/
20+
21+
# mpeltonen/sbt-idea plugin
22+
.idea_modules/
23+
24+
workspace.xml
25+
26+
.vscode/
27+
.idea/

.php-cs-fixer.dist.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->in([
8+
'src',
9+
'tests',
10+
])
11+
->name('*.php')
12+
->exclude('vendor')
13+
->ignoreDotFiles(true)
14+
->ignoreVCS(true);
15+
16+
return (new Config())
17+
->setRules([
18+
'@PSR12' => true,
19+
'strict_param' => true,
20+
'array_syntax' => ['syntax' => 'short'],
21+
'declare_strict_types' => true,
22+
'no_unused_imports' => true,
23+
'single_quote' => true,
24+
'no_extra_blank_lines' => true,
25+
'array_indentation' => true,
26+
'cast_spaces' => true,
27+
'phpdoc_align' => [
28+
'align' => 'vertical',
29+
],
30+
'phpdoc_order' => [
31+
'order' => ['param', 'return', 'throws'],
32+
],
33+
'single_line_empty_body' => false,
34+
])
35+
->setFinder($finder);

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Contributing
2+
3+
> [!IMPORTANT]
4+
> **Important Note on Major Changes**
5+
> For substantial changes or new features that significantly alter the codebase, please discuss your proposed changes with the project maintainer or lead developer before submitting your pull request. This ensures alignment with the project's roadmap and helps avoid potential conflicts.
6+
7+
We appreciate your interest in contributing to this project! To ensure a smooth process, please follow these steps:
8+
9+
1. **Fork the repository**:
10+
11+
Create your own copy of the repository on GitHub.
12+
13+
2. **Create a feature branch**:
14+
15+
Create a new branch for each feature or bug fix with a descriptive name. This helps to keep your work organized and separate from the main codebase.
16+
17+
```bash
18+
$ git checkout -b feature/your-feature-name
19+
```
20+
21+
3. **Write tests**:
22+
23+
Ensure that any changes you make are covered by appropriate tests. This includes unit tests for new features and updates to existing tests where applicable.
24+
25+
4. **Run Tests**:
26+
27+
Before submitting your changes, ensure all tests pass by running the test suite.
28+
29+
```bash
30+
$ composer test
31+
```
32+
33+
5. **Follow coding standards**:
34+
35+
Adhere to the project’s coding standards. We use PSR-12 coding style. You can automatically fix your code using the following commands:
36+
37+
- [**PSR-12 Coding Standard**][1]
38+
The easiest way to apply the conventions is to install [PHP Code Sniffer][2].
39+
40+
- To check for code style issues without fixing them:
41+
42+
```bash
43+
$ composer cs-check
44+
```
45+
46+
- To fix code style issues:
47+
48+
```bash
49+
$ composer cs-fix
50+
```
51+
52+
Ensure that your code is well-documented with clear comments explaining the functionality where necessary.
53+
54+
55+
6. **Commit Your Changes**:
56+
57+
Write clear and concise commit messages that explain your changes.
58+
59+
```bash
60+
$ git commit -m "Add feature X to improve Y"
61+
```
62+
63+
7. **Push Your Branch**:
64+
65+
Push your branch to your forked repository:
66+
67+
```bash
68+
$ git push origin feature/your-feature-name
69+
```
70+
8. **Submit a Pull Request**:
71+
72+
Go to the original repository on GitHub and click "New Pull Request". Provide a clear description of the changes and why they are necessary. Link any related issues if applicable.
73+
74+
> [!IMPORTANT]
75+
> Mention any specific tests that need to be reviewed.
76+
77+
We warmly welcome all contributions and are thankful for your efforts to improve this project.
78+
79+
**Happy coding**!
80+
81+
[1]: <https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md>
82+
[2]: <http://pear.php.net/package/PHP_CodeSniffer>

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) 2025 Griffin T-3H [email protected]
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)