Skip to content

Commit e7ce25f

Browse files
committed
Initial release
0 parents  commit e7ce25f

File tree

210 files changed

+17211
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+17211
-0
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.git* export-ignore
2+
/docs/ export-ignore
3+
/examples/ export-ignore
4+
/tests/ export-ignore
5+
/.php-cs-fixer.dist.php export-ignore
6+
/phpstan.dist.neon export-ignore
7+
/phpunit.dist.xml export-ignore

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [smnandre]

.github/workflows/CI.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
cs:
15+
name: "Code style"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: "Git: checkout"
19+
uses: actions/checkout@v4
20+
21+
- name: "PHP: setup 8.3"
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '8.3'
25+
coverage: none
26+
tools: php-cs-fixer
27+
28+
- name: "Composer: validate"
29+
run: composer validate --strict
30+
31+
- name: "Composer: install"
32+
run: composer install --prefer-dist --no-interaction --no-progress
33+
34+
- name: "Php-CS-Fixer: version"
35+
run: vendor/bin/php-cs-fixer -V
36+
37+
- name: "Php-CS-Fixer: check"
38+
run: vendor/bin/php-cs-fixer fix --diff --dry-run
39+
40+
sa:
41+
name: "Static Analysis"
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: "Git: checkout"
45+
uses: actions/checkout@v4
46+
47+
- name: "PHP: setup 8.4"
48+
uses: shivammathur/setup-php@v2
49+
with:
50+
php-version: '8.4'
51+
coverage: pcov
52+
tools: phpstan
53+
54+
- name: "Composer: install"
55+
run: composer install --prefer-dist --no-interaction --no-progress
56+
57+
- name: "PHPStan: version"
58+
run: vendor/bin/phpstan --version
59+
60+
- name: "PHPStan: analyze"
61+
run: vendor/bin/phpstan
62+
63+
tests:
64+
name: "Tests (PHP ${{ matrix.php-version }})"
65+
runs-on: ubuntu-latest
66+
strategy:
67+
matrix:
68+
php-version: ['8.3', '8.4']
69+
fail-fast: false
70+
steps:
71+
- name: "Git: checkout"
72+
uses: actions/checkout@v4
73+
74+
- name: "PHP: setup ${{ matrix.php-version }}"
75+
uses: shivammathur/setup-php@v2
76+
with:
77+
php-version: ${{ matrix.php-version }}
78+
coverage: pcov
79+
tools: phpunit
80+
81+
- name: "Composer: install"
82+
run: composer install --prefer-dist --no-interaction --no-progress
83+
84+
- name: "PHPUnit: unit tests"
85+
run: vendor/bin/phpunit
86+
87+
- name: "PHPUnit: all tests with coverage"
88+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
89+
90+
- name: "Codecov: upload coverage"
91+
uses: codecov/codecov-action@v5
92+
if: matrix.php-version == '8.4'
93+
with:
94+
files: ./coverage.xml

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.phpunit.cache/
2+
/vendor/
3+
/.php-cs-fixer.cache
4+
/composer.lock
5+
/coverage.xml
6+
/phpstan.neon
7+
/phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
$licence = <<<'EOF'
4+
This file is part of the smnandre/packapi package.
5+
6+
(c) Simon Andre <[email protected]>
7+
8+
For the full copyright and license information, please view the LICENSE
9+
file that was distributed with this source code.
10+
EOF;
11+
12+
$finder = (new PhpCsFixer\Finder())
13+
->in(__DIR__)
14+
->exclude([
15+
'tests',
16+
])
17+
;
18+
19+
return (new PhpCsFixer\Config())
20+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
21+
->setFinder($finder)
22+
->setRiskyAllowed(true)
23+
->setRules([
24+
'@PER-CS' => true,
25+
'@Symfony' => true,
26+
'declare_strict_types' => true,
27+
'strict_param' => true,
28+
'header_comment' => ['header' => $licence],
29+
])
30+
;

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-present Simon André <[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)