Skip to content

Commit ed15187

Browse files
committed
Init
0 parents  commit ed15187

20 files changed

+13625
-0
lines changed

.github/workflows/phpunit.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: PHPUnit Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: [8.1, 8.2, 8.3, 8.4]
16+
17+
name: PHP ${{ matrix.php }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
extensions: dom, curl, libxml, mbstring, zip
28+
coverage: none
29+
30+
- name: Get composer cache directory
31+
id: composer-cache
32+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@v3
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: ${{ runner.os }}-composer-
40+
41+
- name: Install dependencies
42+
run: composer install --prefer-dist --no-interaction --no-progress
43+
44+
- name: Execute tests
45+
run: composer test
46+
env:
47+
APP_ENV: testing
48+
SUPABASE_STORAGE_KEY: ${{ secrets.SUPABASE_STORAGE_KEY }}
49+
SUPABASE_STORAGE_ENDPOINT: ${{ secrets.SUPABASE_STORAGE_ENDPOINT }}
50+
SUPABASE_STORAGE_URL: ${{ secrets.SUPABASE_STORAGE_URL }}

.github/workflows/psalm.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Psalm Static Analysis
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
psalm:
11+
runs-on: ubuntu-latest
12+
name: Psalm
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 8.4
22+
extensions: dom, curl, libxml, mbstring, zip
23+
coverage: none
24+
25+
- name: Get composer cache directory
26+
id: composer-cache
27+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: ${{ runner.os }}-composer-
35+
36+
- name: Install dependencies
37+
run: composer install --prefer-dist --no-interaction --no-progress
38+
39+
- name: Execute Psalm
40+
run: composer psalm

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/vendor/
2+
.alies/composer.lock
3+
.phpunit.result.cache
4+
.phpunit.cache
5+
.php-cs-fixer.cache
6+
.php_cs.cache
7+
.env

.php-cs-fixer.php

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php declare(strict_types=1);
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->exclude([
8+
'.build/',
9+
'.github/',
10+
])
11+
->in(__DIR__);
12+
13+
$config = new Config();
14+
15+
$config->setFinder($finder);
16+
$config->setRules([
17+
// Basic PER Coding Style 2.0 ruleset plus our overrides for it, see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/PER-CS2.0.rst
18+
'@PER-CS2.0' => true, // https://www.php-fig.org/per/coding-style/}
19+
'new_with_parentheses' => ['anonymous_class' => true], // It will be changed in PHP-CS-Fixer v4.0 (but we want to enforce it), see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8148
20+
// overrides for PER-CS2.0
21+
'concat_space' => ['spacing' => 'none'], // make strings shorter "'hello' . $name . '!'" => "'hello'.$name.'!'"
22+
'blank_line_after_opening_tag' => false, // it makes "<?php declare(strict_types=1);" multiline (and more verbose)
23+
24+
// Additional rules on the top of PER-CS2
25+
// Please keep these rules alphabetically
26+
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'],
27+
'array_indentation' => true,
28+
'assign_null_coalescing_to_coalesce_equal' => true,
29+
'binary_operator_spaces' => ['default' => 'single_space'],
30+
'cast_spaces' => ['space' => 'single'],
31+
'class_attributes_separation' => ['elements' => ['method' => 'one']],
32+
'declare_strict_types' => true,
33+
'explicit_string_variable' => true,
34+
'final_public_method_for_abstract_class' => true,
35+
'general_phpdoc_annotation_remove' => [
36+
'annotations' => [
37+
'access',
38+
'author',
39+
'category',
40+
'copyright',
41+
'created',
42+
'license',
43+
'link',
44+
'package',
45+
'since',
46+
'subpackage',
47+
],
48+
],
49+
'modernize_types_casting' => true,
50+
'mb_str_functions' => true,
51+
'no_alias_functions' => true,
52+
'no_binary_string' => true,
53+
'no_empty_comment' => true,
54+
'no_empty_phpdoc' => true,
55+
'no_empty_statement' => true,
56+
'no_extra_blank_lines' => ['tokens' => ['extra', 'curly_brace_block']],
57+
'no_homoglyph_names' => true,
58+
'no_leading_namespace_whitespace' => true,
59+
'no_mixed_echo_print' => true,
60+
'no_short_bool_cast' => true,
61+
'no_singleline_whitespace_before_semicolons' => true,
62+
'no_spaces_around_offset' => true,
63+
'no_trailing_comma_in_singleline' => false, // it's a good marker that there are more elements in an array
64+
'no_unneeded_braces' => true,
65+
'no_unneeded_control_parentheses' => true,
66+
'no_unneeded_final_method' => true,
67+
'no_unreachable_default_argument_value' => true,
68+
'no_unused_imports' => true,
69+
'no_useless_concat_operator' => true,
70+
'no_useless_return' => true,
71+
'no_whitespace_before_comma_in_array' => true,
72+
'normalize_index_brace' => true,
73+
'nullable_type_declaration' => ['syntax' => 'question_mark'],
74+
'object_operator_without_whitespace' => true,
75+
'ordered_class_elements' => [
76+
'order' => [
77+
'use_trait',
78+
'constant',
79+
'case', // for enums only
80+
'property',
81+
'method',
82+
]
83+
],
84+
'php_unit_attributes' => true,
85+
'php_unit_construct' => true,
86+
'php_unit_dedicate_assert' => ['target' => 'newest'],
87+
'php_unit_expectation' => true,
88+
'php_unit_fqcn_annotation' => true,
89+
'php_unit_method_casing' => ['case' => 'snake_case'],
90+
'php_unit_no_expectation_annotation' => true,
91+
'php_unit_set_up_tear_down_visibility' => true,
92+
'php_unit_strict' => true,
93+
'php_unit_test_annotation' => ['style' => 'annotation'],
94+
'phpdoc_align' => ['align' => 'left'],
95+
'phpdoc_array_type' => true,
96+
'phpdoc_indent' => true,
97+
'phpdoc_line_span' => ['const' => 'single', 'property' => 'single', 'method' => 'single'],
98+
'phpdoc_param_order' => true,
99+
'phpdoc_scalar' => true,
100+
'phpdoc_single_line_var_spacing' => true,
101+
'phpdoc_tag_casing' => true,
102+
'phpdoc_types' => true,
103+
'protected_to_private' => true,
104+
'psr_autoloading' => true,
105+
'self_accessor' => true,
106+
'self_static_accessor' => true,
107+
'single_line_comment_spacing' => true,
108+
'single_line_comment_style' => ['comment_types' => ['asterisk', 'hash']],
109+
'space_after_semicolon' => true,
110+
'standardize_not_equals' => true,
111+
'strict_param' => true,
112+
'ternary_to_null_coalescing' => true,
113+
'trim_array_spaces' => true,
114+
'trailing_comma_in_multiline' => true,
115+
'type_declaration_spaces' => true,
116+
'types_spaces' => ['space' => 'single'],
117+
'whitespace_after_comma_in_array' => true,
118+
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
119+
]);
120+
121+
return $config;

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Alies Dev
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)