Skip to content

Commit 8ac500d

Browse files
committed
feat: rewrite package for PHP 8.2 and Twig 3.11
1 parent bf3a940 commit 8ac500d

Some content is hidden

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

70 files changed

+2159
-1312
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# This applies to all files
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
charset = utf-8
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{yml,yaml}]
16+
indent_size = 2

.gitattributes

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
/.gitattributes export-ignore
2-
/.gitignore export-ignore
3-
/.travis.yml export-ignore
4-
/phpunit.xml.dist export-ignore
5-
/tests export-ignore
6-
/tools export-ignore
1+
/.allowed-licenses export-ignore
2+
/.editorconfig export-ignore
3+
/.gitattributes export-ignore
4+
/.github/ export-ignore
5+
/.gitignore export-ignore
6+
/bin/ export-ignore
7+
/build/ export-ignore
8+
/captainhook.json export-ignore
9+
/CHANGELOG.md export-ignore
10+
/codecov.yml export-ignore
11+
/CODE_OF_CONDUCT.md export-ignore
12+
/CONTRIBUTING.md export-ignore
13+
/conventional-commits.json export-ignore
14+
/docs/ export-ignore
15+
/phpcs.xml.dist export-ignore
16+
/phpstan.neon.dist export-ignore
17+
/phpunit.xml.dist export-ignore
18+
/psalm-baseline.xml export-ignore
19+
/psalm.xml export-ignore
20+
/resources/ export-ignore
21+
/SECURITY.md export-ignore
22+
/tests/ export-ignore

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ramsey
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report
3+
about: Create a bug report to help us improve
4+
labels: bug
5+
assignees:
6+
---
7+
<!--- Provide a general summary of the issue you're having in the title above. -->
8+
9+
## Description
10+
<!-- Provide a short and clear description of the bug. -->
11+
12+
## Steps to reproduce
13+
<!--
14+
Provide steps to reproduce the behavior you are experiencing. Please try to keep
15+
this as short as possible. If able, create a reproducible script outside of any
16+
framework you are using. This will help us to quickly debug the issue.
17+
-->
18+
1. Step one...
19+
2. Step two...
20+
3. Step three...
21+
22+
## Expected behavior
23+
<!-- Provide a short and clear description of what you expect to happen. -->
24+
25+
## Screenshots or output
26+
<!-- If applicable, add screenshots or program output to help explain your problem. -->
27+
28+
## Environment details
29+
<!-- Provide details about the system where you're using this package. -->
30+
- version of this package: *e.g. 1.0.0, 1.0.1, 1.1.0*
31+
- PHP version: *e.g. 7.3.16, 7.4.4*
32+
- OS: *e.g. Windows 10, Linux (Ubuntu 18.04.1), macOS Catalina (10.15.3)*
33+
34+
## Additional context
35+
<!-- Provide any additional context that may help us debug the problem. -->
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a feature for this project
4+
labels: enhancement
5+
assignees:
6+
---
7+
<!--- Provide a general summary of your feature request in the title above. -->
8+
9+
<!-- Give your feature a short title here. -->
10+
## My feature title
11+
<!-- Provide a short and clear description of the feature. -->
12+
13+
## Background/problem
14+
<!--
15+
Provide background details to show why this feature is necessary. Is your
16+
feature request related to a problem? If so, please describe the problem.
17+
Provide as much detail as possible.
18+
-->
19+
20+
## Proposal/solution
21+
<!--
22+
Provide a short and clear description of the solution you'd like. Include code
23+
examples, if possible. Feel free to use pseudo-code to show how you think the
24+
feature should work.
25+
-->
26+
27+
## Alternatives
28+
<!-- Describe any alternative solutions or features you've considered. -->
29+
30+
## Additional context
31+
<!-- Please provide any other context or code examples that may help. -->

.github/ISSUE_TEMPLATE/Question.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Question
3+
about: Ask a question about how to use this library
4+
labels: question
5+
assignees:
6+
---
7+
<!--- Provide a general summary of your question in the title above. -->
8+
9+
<!-- Write your question here. -->
10+
## How do I... ?
11+
<!-- Provide any additional context that may help us answer your question. -->
12+
13+
## Example code
14+
<!--
15+
If your question is about code that you've written, provide a short and clear
16+
example of what you're trying to accomplish. Try to keep this as short as
17+
possible. If able, please provide an example outside of any framework you are
18+
using. This will help us to quickly respond to your question.
19+
-->

.github/ISSUE_TEMPLATE/config.yml

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

.github/dependabot.yml

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

.github/pull_request_template.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--- Provide a general summary of your changes in the title above. -->
2+
3+
## Description
4+
<!--- Describe your changes in detail. -->
5+
6+
## Motivation and context
7+
<!--- Why is this change required? What problem does it solve? -->
8+
<!--- If it fixes an open issue, please link to the issue here. -->
9+
10+
## How has this been tested?
11+
<!--- Please describe in detail how you tested your changes. -->
12+
<!--- Include details of your testing environment, and the tests you ran to -->
13+
<!--- see how your change affects other areas of the code, etc. -->
14+
15+
## Types of changes
16+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
17+
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] New feature (non-breaking change which adds functionality)
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
20+
21+
## PR checklist
22+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
23+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
24+
- [ ] My change requires a change to the documentation.
25+
- [ ] I have updated the documentation accordingly.
26+
- [ ] I have read the **CONTRIBUTING.md** document.
27+
- [ ] I have added tests to cover my changes.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# GitHub Actions Documentation: https://docs.github.com/en/actions
2+
3+
name: "Continuous Integration"
4+
5+
on:
6+
push:
7+
branches:
8+
- "main"
9+
tags:
10+
- "*"
11+
pull_request:
12+
branches:
13+
- "main"
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
env:
22+
COMPOSER_ROOT_VERSION: "1.99.99"
23+
24+
jobs:
25+
coding-standards:
26+
name: "Coding standards"
27+
runs-on: "ubuntu-latest"
28+
steps:
29+
- name: "Checkout repository"
30+
uses: "actions/checkout@v4"
31+
32+
- name: "Install PHP"
33+
uses: "shivammathur/setup-php@v2"
34+
with:
35+
php-version: "latest"
36+
coverage: "none"
37+
38+
- name: "Install dependencies (Composer)"
39+
uses: "ramsey/composer-install@v3"
40+
41+
- name: "Check syntax (php-parallel-lint)"
42+
run: "composer dev:lint:syntax"
43+
44+
- name: "Check coding standards (PHP_CodeSniffer)"
45+
run: "composer dev:lint:style"
46+
47+
static-analysis:
48+
name: "Static analysis"
49+
runs-on: "ubuntu-latest"
50+
steps:
51+
- name: "Checkout repository"
52+
uses: "actions/checkout@v4"
53+
54+
- name: "Install PHP"
55+
uses: "shivammathur/setup-php@v2"
56+
with:
57+
php-version: "latest"
58+
coverage: "none"
59+
60+
- name: "Install dependencies (Composer)"
61+
uses: "ramsey/composer-install@v3"
62+
63+
- name: "Statically analyze code (PHPStan)"
64+
run: "composer dev:analyze:phpstan"
65+
66+
code-coverage:
67+
name: "Code coverage"
68+
needs: ["coding-standards", "static-analysis"]
69+
runs-on: "ubuntu-latest"
70+
steps:
71+
- name: "Checkout repository"
72+
uses: "actions/checkout@v4"
73+
74+
- name: "Install PHP"
75+
uses: "shivammathur/setup-php@v2"
76+
with:
77+
php-version: "latest"
78+
coverage: "xdebug"
79+
80+
- name: "Install dependencies (Composer)"
81+
uses: "ramsey/composer-install@v3"
82+
83+
- name: "Run unit tests (PHPUnit)"
84+
run: "composer dev:test:coverage:ci"
85+
86+
- name: "Publish coverage report to Codecov"
87+
uses: "codecov/codecov-action@v5"
88+
89+
unit-tests:
90+
name: "Unit tests"
91+
needs: ["code-coverage"]
92+
runs-on: "ubuntu-latest"
93+
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
php-version:
98+
- "8.2"
99+
- "8.3"
100+
- "8.4"
101+
102+
steps:
103+
- name: "Checkout repository"
104+
uses: "actions/checkout@v4"
105+
106+
- name: "Install PHP"
107+
uses: "shivammathur/setup-php@v2"
108+
with:
109+
php-version: "${{ matrix.php-version }}"
110+
coverage: "none"
111+
112+
- name: "Install dependencies (Composer)"
113+
uses: "ramsey/composer-install@v3"
114+
115+
- name: "Run unit tests (PHPUnit)"
116+
run: "composer dev:test:unit"

0 commit comments

Comments
 (0)