Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 6ffb587

Browse files
committed
Initial project commit
1 parent 39afaf2 commit 6ffb587

38 files changed

+5579
-8
lines changed

.github/workflows/phpcsfixer.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP-CS-Fixer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
fix-style:
13+
name: PHP-CS-Fixer Enforce Code Style
14+
timeout-minutes: 15
15+
runs-on: ubuntu-latest
16+
env:
17+
COMPOSER_NO_INTERACTION: 1
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.1
27+
coverage: none
28+
tools: composer:v2
29+
30+
- name: Install dependencies
31+
run: composer update --prefer-dist --no-suggest --no-progress
32+
33+
- name: Run PHP-CS-Fixer
34+
run: composer style
35+
continue-on-error: true
36+
37+
- name: Don't Commit composer.json change
38+
run: git checkout -- composer.json
39+
40+
- name: Don't Commit composer.lock change
41+
run: git checkout -- composer.lock
42+
43+
- name: Commit any changes back to the repo
44+
uses: stefanzweifel/git-auto-commit-action@v4
45+
with:
46+
commit_message: "[GitHub Action: PHP-CS-Fixer] composer fix-style"
47+
commit_author: othyn-github-actions <github@othyn.com>

.github/workflows/phpunit.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PHPUnit
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
php-tests:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 15
15+
env:
16+
COMPOSER_NO_INTERACTION: 1
17+
18+
strategy:
19+
matrix:
20+
php: [8.1]
21+
dependency-version: [prefer-lowest, prefer-stable]
22+
phpunit: [9.5.13]
23+
24+
name: PHPUnit-${{ matrix.phpunit }} -- PHP-${{ matrix.php }} -- ${{ matrix.dependency-version }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Install dependencies
31+
uses: php-actions/composer@v5
32+
33+
- name: PHPUnit Tests
34+
uses: php-actions/phpunit@v2
35+
with:
36+
version: ${{ matrix.phpunit }}
37+
php_version: ${{ matrix.php }}
38+
php_extensions: xdebug

.gitignore

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
composer.phar
2-
/vendor/
3-
4-
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
5-
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6-
# composer.lock
1+
vendor
2+
.phpunit.result.cache

.php-cs-fixer.dist.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests');
6+
7+
return (new PhpCsFixer\Config())
8+
->setRules([
9+
'@Symfony' => true,
10+
'no_superfluous_phpdoc_tags' => true,
11+
'php_unit_method_casing' => [
12+
'case' => 'snake_case',
13+
],
14+
'yoda_style' => [
15+
'equal' => false,
16+
'identical' => false,
17+
'less_and_greater' => false,
18+
],
19+
'binary_operator_spaces' => [
20+
'operators' => [
21+
'=>' => 'align_single_space_minimal',
22+
'=' => 'align_single_space_minimal',
23+
],
24+
],
25+
])
26+
->setLineEnding("\n")
27+
->setUsingCache(false)
28+
->setRiskyAllowed(true)
29+
->setFinder($finder);

0 commit comments

Comments
 (0)