Skip to content

Commit c283603

Browse files
committed
First commit
0 parents  commit c283603

91 files changed

Lines changed: 8393 additions & 0 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml,*.yaml,*.neon,*.mdx]
15+
indent_style = space
16+
indent_size = 2

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* text=auto
2+
3+
/.editorconfig export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.github export-ignore
7+
/.markdownlint.json export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/phpstan.dist.neon export-ignore
10+
/README.md export-ignore
11+
/ecs.php export-ignore
12+
/rector.php export-ignore
13+
/tests export-ignore
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: 'Setup PHP and Composer'
2+
description: 'Setup PHP and install Composer dependencies with caching'
3+
4+
inputs:
5+
php-version:
6+
description: 'PHP version to use'
7+
required: false
8+
default: '8.3'
9+
coverage:
10+
description: 'Coverage driver to use (none, xdebug, pcov)'
11+
required: false
12+
default: 'none'
13+
stability:
14+
description: 'Composer stability preference (prefer-stable, prefer-lowest)'
15+
required: false
16+
default: 'prefer-stable'
17+
extensions:
18+
description: 'PHP extensions to install'
19+
required: false
20+
default: 'dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo'
21+
22+
runs:
23+
using: 'composite'
24+
steps:
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ inputs.php-version }}
29+
coverage: ${{ inputs.coverage }}
30+
extensions: ${{ inputs.extensions }}
31+
32+
- name: Get Composer Cache Directory
33+
id: composer-cache
34+
shell: bash
35+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36+
37+
- name: Cache Composer dependencies
38+
uses: actions/cache@v5
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ inputs.stability }}-${{ hashFiles('**/composer.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-composer-${{ inputs.stability }}-
44+
45+
- name: Install dependencies
46+
shell: bash
47+
run: |
48+
if [ "${{ inputs.stability }}" = "prefer-lowest" ]; then
49+
composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
50+
else
51+
composer install --prefer-dist --no-interaction --no-progress
52+
fi
53+

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
labels:
8+
- "dependencies"
9+
- "composer"
10+
versioning-strategy: "increase-if-necessary"
11+
open-pull-requests-limit: 5
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"
17+
labels:
18+
- "dependencies"
19+
- "github-actions"

.github/workflows/run-tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
7+
on: [push]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
os: [ubuntu-latest, windows-latest]
20+
php: [8.3, 8.4, 8.5]
21+
stability: [prefer-lowest, prefer-stable]
22+
23+
name: PHP${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v6
28+
29+
- name: Setup PHP and Composer
30+
uses: ./.github/actions/setup-php-composer
31+
with:
32+
php-version: ${{ matrix.php }}
33+
coverage: pcov
34+
stability: ${{ matrix.stability }}
35+
36+
- name: Setup problem matchers
37+
run: |
38+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
39+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
40+
41+
- name: Execute tests with mutation
42+
if: ${{ matrix.os == 'ubuntu-latest' }}
43+
run: vendor/bin/pest --colors=always --mutate --parallel --min=80
44+
45+
- name: Execute tests
46+
if: ${{ matrix.os != 'ubuntu-latest' }}
47+
run: vendor/bin/pest --colors=always
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Static Analysis
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
7+
on: [push]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
phpstan:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Setup PHP and Composer
22+
uses: ./.github/actions/setup-php-composer
23+
24+
- name: Cache phpstan results
25+
uses: actions/cache@v5
26+
with:
27+
path: .phpstan-cache
28+
key: "result-cache-${{ github.run_id }}" # always write a new cache
29+
restore-keys: |
30+
result-cache-
31+
32+
- name: Run phpstan
33+
run: vendor/bin/phpstan analyse -c phpstan.dist.neon --no-progress --error-format=github
34+
35+
type-coverage:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v6
40+
41+
- name: Setup PHP and Composer
42+
uses: ./.github/actions/setup-php-composer
43+
44+
- name: Check type coverage
45+
run: vendor/bin/pest --type-coverage --min=100
46+
47+
format:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v6
52+
53+
- name: Setup PHP and Composer
54+
uses: ./.github/actions/setup-php-composer
55+
56+
- name: Cache rector results
57+
uses: actions/cache@v5
58+
with:
59+
path: /tmp/rector
60+
key: "rector-cache-${{ github.run_id }}" # always write a new cache
61+
restore-keys: |
62+
rector-cache-
63+
64+
- name: Cache ecs results
65+
uses: actions/cache@v5
66+
with:
67+
path: /tmp/ecs
68+
key: "ecs-cache-${{ github.run_id }}" # always write a new cache
69+
restore-keys: |
70+
ecs-cache-
71+
72+
- name: Run format checks
73+
run: composer format:check --no-progress-bar

.github/workflows/sync-docs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Sync Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
9+
jobs:
10+
notify-docs-repo:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: peter-evans/repository-dispatch@v4
16+
with:
17+
token: ${{ secrets.DOCS_TOKEN }}
18+
repository: cortexphp/docs
19+
event-type: docs-updated

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
vendor
2+
composer.lock
3+
.vscode
4+
.env
5+
.DS_Store
6+
.phpstan-cache
7+
coverage
8+
.claude

.markdownlint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"default": true,
3+
"MD013": false,
4+
"MD033": false,
5+
"MD041": false,
6+
"no-hard-tabs": true
7+
}

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Sean Tymon <tymon148@gmail.com>
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
13+
all 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
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)