Skip to content

Commit 4b55530

Browse files
committed
Initial commit
0 parents  commit 4b55530

28 files changed

+5542
-0
lines changed

.dependabot/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://dependabot.com/docs/config-file/
2+
3+
version: 1
4+
5+
update_configs:
6+
- default_assignees:
7+
- "localheinz"
8+
default_reviewers:
9+
- "localheinz"
10+
directory: "/"
11+
package_manager: "php:composer"
12+
update_schedule: "live"
13+
version_requirement_updates: "increase_versions"

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.json]
11+
indent_size = 2
12+
13+
[*.neon]
14+
indent_style = tab
15+
16+
[*.yml]
17+
indent_size = 2
18+
19+
[Makefile]
20+
indent_style = tab

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.dependabot/ export-ignore
2+
/.github/ export-ignore
3+
/test/ export-ignore
4+
/.editorconfig export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.php_cs export-ignore
8+
/infection.json export-ignore
9+
/Makefile export-ignore
10+
/phpstan.neon export-ignore

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @localheinz

.github/CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

.github/CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# CONTRIBUTING
2+
3+
We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.
4+
5+
For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).
6+
7+
## Coding Standards
8+
9+
We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards.
10+
11+
Run
12+
13+
```
14+
$ make cs
15+
```
16+
17+
to automatically fix coding standard violations.
18+
19+
## Static Code Analysis
20+
21+
We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) to statically analyze the code.
22+
23+
Run
24+
25+
```
26+
$ make stan
27+
```
28+
29+
to run a static code analysis.
30+
31+
## Tests
32+
33+
We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.
34+
35+
Run
36+
37+
```
38+
$ make test
39+
```
40+
41+
to run all the tests.
42+
43+
## Mutation Tests
44+
45+
We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.
46+
47+
Enable `Xdebug` and run
48+
49+
```
50+
$ make infection
51+
```
52+
53+
to run mutation tests.
54+
55+
## Extra lazy?
56+
57+
Run
58+
59+
```
60+
$ make
61+
```
62+
63+
to enforce coding standards, perform a static code analysis, and run tests!
64+
65+
:bulb: Run
66+
67+
```
68+
$ make help
69+
```
70+
71+
to display a list of available targets with corresponding descriptions.

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
custom: https://www.buymeacoffee.com/localheinz
2+
github: localheinz
3+
patreon: localheinz

.github/ISSUE_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#### Steps required to reproduce the problem
2+
3+
1.
4+
2.
5+
3.
6+
7+
#### Expected Result
8+
9+
*
10+
11+
#### Actual Result
12+
13+
*

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This PR
2+
3+
* [x]
4+
* [ ]
5+
* [ ]
6+
7+
Follows #.
8+
Related to #.
9+
Fixes #.

.github/settings.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# https://github.com/probot/settings
2+
3+
branches:
4+
- name: master
5+
protection:
6+
enforce_admins: false
7+
required_pull_request_reviews:
8+
dismiss_stale_reviews: true
9+
require_code_owner_reviews: true
10+
required_approving_review_count: 1
11+
required_status_checks:
12+
contexts:
13+
- "Coding Standards"
14+
- "Static Code Analysis"
15+
- "Tests (php7.2, lowest)"
16+
- "Tests (php7.2, locked)"
17+
- "Tests (php7.2, highest)"
18+
- "Tests (php7.3, lowest)"
19+
- "Tests (php7.3, locked)"
20+
- "Tests (php7.3, highest)"
21+
- "Code Coverage"
22+
- "Mutation Tests"
23+
- "codecov/patch"
24+
- "codecov/project"
25+
strict: false
26+
restrictions: null
27+
28+
labels:
29+
- name: bug
30+
color: ee0701
31+
32+
- name: dependencies
33+
color: 0366d6
34+
35+
- name: enhancement
36+
color: 0e8a16
37+
38+
- name: stale
39+
color: eeeeee
40+
41+
repository:
42+
allow_merge_commit: true
43+
allow_rebase_merge: false
44+
allow_squash_merge: false
45+
default_branch: master
46+
description: ":ledger: Provides a GitHub repository template for a PHP library."
47+
has_downloads: true
48+
has_issues: true
49+
has_pages: false
50+
has_projects: false
51+
has_wiki: false
52+
name: php-library-template
53+
private: false
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
name: "Continuous Integration"
8+
9+
jobs:
10+
coding-standards:
11+
name: "Coding Standards"
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: actions/checkout@master
18+
19+
- name: "Validate composer.json and composer.lock"
20+
run: php7.2 /usr/bin/composer validate --strict
21+
22+
- name: "Install locked dependencies with composer"
23+
run: php7.2 /usr/bin/composer install
24+
25+
- name: "Run localheinz/composer-normalize"
26+
run: php7.2 /usr/bin/composer normalize --dry-run
27+
28+
- name: "Run friendsofphp/php-cs-fixer"
29+
run: php7.2 vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --using-cache=no --verbose
30+
31+
static-code-analysis:
32+
name: "Static Code Analysis"
33+
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: "Checkout"
38+
uses: actions/checkout@master
39+
40+
- name: "Install locked dependencies with composer"
41+
run: php7.2 /usr/bin/composer install
42+
43+
- name: "Run phpstan/phpstan"
44+
run: php7.2 vendor/bin/phpstan analyse --configuration=phpstan.neon
45+
46+
tests:
47+
name: "Tests"
48+
49+
runs-on: ubuntu-latest
50+
51+
strategy:
52+
matrix:
53+
php-binary:
54+
- php7.2
55+
- php7.3
56+
57+
dependencies:
58+
- lowest
59+
- locked
60+
- highest
61+
62+
steps:
63+
- name: "Checkout"
64+
uses: actions/checkout@master
65+
66+
- name: "Install lowest dependencies with composer"
67+
if: matrix.dependencies == 'lowest'
68+
run: ${{ matrix.php-binary }} /usr/bin/composer update --prefer-lowest
69+
70+
- name: "Install locked dependencies with composer"
71+
if: matrix.dependencies == 'locked'
72+
run: ${{ matrix.php-binary }} /usr/bin/composer install
73+
74+
- name: "Install highest dependencies with composer"
75+
if: matrix.dependencies == 'highest'
76+
run: ${{ matrix.php-binary }} /usr/bin/composer update
77+
78+
- name: "Run auto-review tests with phpunit/phpunit"
79+
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml
80+
81+
- name: "Run unit tests with phpunit/phpunit"
82+
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Unit/phpunit.xml
83+
84+
- name: "Run integration tests with phpunit/phpunit"
85+
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Integration/phpunit.xml
86+
87+
code-coverage:
88+
name: "Code Coverage"
89+
90+
runs-on: ubuntu-latest
91+
92+
steps:
93+
- name: "Checkout"
94+
uses: actions/checkout@master
95+
96+
- name: "Install locked dependencies with composer"
97+
run: php7.3 /usr/bin/composer install
98+
99+
- name: "Dump Xdebug filter with phpunit/phpunit"
100+
run: php7.3 vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php
101+
102+
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
103+
run: php7.3 vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php
104+
105+
- name: "Download code coverage uploader for Codecov.io"
106+
run: curl -s https://codecov.io/bash -o codecov
107+
108+
- name: "Send code coverage report to Codecov.io"
109+
run: bash codecov -t ${{ secrets.CODECOV_TOKEN }}
110+
111+
mutation-tests:
112+
name: "Mutation Tests"
113+
114+
runs-on: ubuntu-latest
115+
116+
steps:
117+
- name: "Checkout"
118+
uses: actions/checkout@master
119+
120+
- name: "Install locked dependencies with composer"
121+
run: php7.3 /usr/bin/composer install
122+
123+
- name: "Run mutation tests with infection/infection"
124+
run: php7.3 vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=100 --min-msi=100

0 commit comments

Comments
 (0)