Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 4b1eec1

Browse files
committed
Initial commit
0 parents  commit 4b1eec1

18 files changed

Lines changed: 554 additions & 0 deletions

.editorconfig

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

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore
10+
/.editorconfig export-ignore
11+
/.php_cs.dist export-ignore
12+
/psalm.xml export-ignore
13+
/psalm.xml.dist export-ignore
14+
/testbench.yaml export-ignore
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: lint-commit-message
2+
on: push
3+
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
name: conventional
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@master
11+
with:
12+
fetch-depth: 0
13+
- uses: wagoid/commitlint-github-action@v3
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: lint-pull-request-title
2+
3+
on:
4+
pull_request:
5+
types: ['opened', 'edited', 'reopened', 'synchronize']
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@master
13+
- name: Install dependencies
14+
run: npm install @commitlint/config-conventional
15+
- uses: JulienKode/pull-request-name-linter-action@v0.2.0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: draft-new-release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@master
13+
- name: Generate changelog
14+
id: changelog
15+
uses: metcalfc/changelog-generator@v1.0.0
16+
with:
17+
myToken: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Draft release
19+
id: draft_release
20+
uses: actions/create-release@latest
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: ${{ github.ref }}
26+
body: ${{ steps.changelog.outputs.changelog }}
27+
draft: false
28+
prerelease: false

.github/workflows/run-lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: run-lint
2+
3+
on: pull_request
4+
5+
jobs:
6+
php-cs-fixer:
7+
name: php-cs check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@master
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@master
14+
with:
15+
php-version: 8.0
16+
coverage: none
17+
tools: cs2pr
18+
- name: Install dependencies
19+
run: composer i
20+
- name: Run linter
21+
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --format=checkstyle | cs2pr

.github/workflows/run-psalm.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: run-psalm
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'psalm.xml.dist'
8+
9+
jobs:
10+
psalm:
11+
name: psalm
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.0'
20+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
21+
coverage: none
22+
23+
- name: Cache composer dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: vendor
27+
key: composer-${{ hashFiles('composer.lock') }}
28+
29+
- name: Run composer install
30+
run: composer install -n --prefer-dist
31+
32+
- name: Run psalm
33+
run: ./vendor/bin/psalm --output-format=github
34+
35+
- name: Run psalm security analysis
36+
run: ./vendor/bin/psalm --taint-analysis

.github/workflows/run-tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
php: [8.0]
15+
stability: [prefer-lowest, prefer-stable]
16+
17+
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
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: ${{ matrix.php }}
27+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
28+
coverage: none
29+
30+
- name: Setup problem matchers
31+
run: |
32+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
33+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
34+
35+
- name: Install dependencies
36+
run: |
37+
composer install --${{ matrix.stability }} --prefer-dist --no-interaction
38+
39+
- name: Execute tests
40+
run: vendor/bin/phpunit

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.idea
2+
.php_cs
3+
.php_cs.cache
4+
.phpunit.result.cache
5+
build
6+
test-results
7+
composer.lock
8+
coverage
9+
docs
10+
phpunit.xml
11+
psalm.xml
12+
testbench.yaml
13+
vendor
14+
node_modules
15+
.php-cs-fixer.cache
16+
.DS_Store

.php-cs-fixer.dist.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return (new LiveIntent\PhpCsFixer\Config())->setFinder($finder);

0 commit comments

Comments
 (0)