Skip to content

Commit 01bb292

Browse files
committed
Fix phpstan errors
1 parent 058888d commit 01bb292

File tree

9 files changed

+209
-244
lines changed

9 files changed

+209
-244
lines changed

.editorconfig

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ trim_trailing_whitespace = true
1111
[*.md]
1212
trim_trailing_whitespace = false
1313

14-
[*.yml]
15-
indent_style = space
16-
indent_size = 4
14+
[{*.yml,*.yaml,*.neon}]
15+
indent_size = 2

.gitattributes

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
* text=auto
2-
3-
/.github export-ignore
4-
/tests export-ignore
1+
* text=auto eol=lf
2+
*.pp eol=lf linguist-language=EBNF
3+
*.pp2 eol=lf linguist-language=EBNF
54

65
.editorconfig export-ignore
6+
.php-cs-fixer.php export-ignore
77
.gitattributes export-ignore
88
.gitignore export-ignore
9-
.styleci.yml export-ignore
10-
.travis.yml export-ignore
119

12-
monorepo-builder.php export-ignore
1310
phpunit.xml export-ignore
11+
psalm.xml export-ignore
12+
rector.php export-ignore
13+
14+
/.github export-ignore
15+
/example export-ignore
16+
/tests export-ignore

.github/workflows/codestyle.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: codestyle
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
psalm:
9+
name: Code Style
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.3' ]
15+
os: [ ubuntu-latest ]
16+
steps:
17+
- name: Set Git To Use LF
18+
run: |
19+
git config --global core.autocrlf false
20+
git config --global core.eol lf
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
- name: Setup PHP ${{ matrix.php }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
- name: Validate Composer
28+
run: composer validate
29+
- name: Install Dependencies
30+
uses: nick-invision/retry@v2
31+
with:
32+
timeout_minutes: 5
33+
max_attempts: 5
34+
command: composer update --prefer-dist --no-interaction --no-progress
35+
- name: Check Code Style
36+
run: composer phpcs:check

.github/workflows/main.yml

+34-196
Original file line numberDiff line numberDiff line change
@@ -1,201 +1,39 @@
11
name: build
22

33
on:
4-
push:
5-
pull_request:
6-
schedule:
7-
- cron: '0 0 * * *'
8-
9-
env:
10-
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
4+
push:
5+
pull_request:
116

127
jobs:
13-
security:
14-
name: Security
15-
runs-on: ${{ matrix.os }}
16-
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
php: [ '8.1' ]
21-
os: [ ubuntu-latest ]
22-
23-
steps: # General Steps
24-
- name: Set Git To Use LF
25-
run: |
26-
git config --global core.autocrlf false
27-
git config --global core.eol lf
28-
- name: Checkout
29-
uses: actions/checkout@v2
30-
31-
# Install PHP Dependencies
32-
- name: Setup PHP ${{ matrix.php }}
33-
uses: shivammathur/setup-php@v2
34-
with:
35-
php-version: ${{ matrix.php }}
36-
- name: Validate Composer
37-
run: composer validate
38-
- name: Get Composer Cache Directory
39-
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
40-
id: composer-cache
41-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42-
- name: Restore Composer Cache
43-
uses: actions/cache@v1
44-
with:
45-
path: ${{ steps.composer-cache.outputs.dir }}
46-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
47-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
48-
- name: Install Dependencies
49-
uses: nick-invision/retry@v1
50-
with:
51-
timeout_minutes: 5
52-
max_attempts: 5
53-
command: composer update --prefer-dist --no-interaction --no-progress
54-
55-
# Execution
56-
- name: Security Advisories
57-
run: composer require --dev roave/security-advisories:dev-latest
58-
59-
static-analysis:
60-
name: Psalm
61-
runs-on: ${{ matrix.os }}
62-
63-
strategy:
64-
fail-fast: false
65-
matrix:
66-
php: [ '8.1' ]
67-
os: [ ubuntu-latest ]
68-
69-
steps: # General Steps
70-
- name: Set Git To Use LF
71-
run: |
72-
git config --global core.autocrlf false
73-
git config --global core.eol lf
74-
- name: Checkout
75-
uses: actions/checkout@v2
76-
77-
# Install PHP Dependencies
78-
- name: Setup PHP ${{ matrix.php }}
79-
uses: shivammathur/setup-php@v2
80-
with:
81-
php-version: ${{ matrix.php }}
82-
- name: Validate Composer
83-
run: composer validate
84-
- name: Get Composer Cache Directory
85-
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
86-
id: composer-cache
87-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
88-
- name: Restore Composer Cache
89-
uses: actions/cache@v1
90-
with:
91-
path: ${{ steps.composer-cache.outputs.dir }}
92-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
93-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
94-
- name: Install Dependencies
95-
uses: nick-invision/retry@v1
96-
with:
97-
timeout_minutes: 5
98-
max_attempts: 5
99-
command: composer update --prefer-dist --no-interaction --no-progress
100-
101-
# Execution
102-
- name: Static Analysis
103-
continue-on-error: true
104-
run: vendor/bin/psalm --no-cache
105-
106-
coding-standards:
107-
name: Coding Standards
108-
runs-on: ${{ matrix.os }}
109-
110-
strategy:
111-
fail-fast: false
112-
matrix:
113-
php: [ '8.1' ]
114-
os: [ ubuntu-latest ]
115-
116-
steps: # General Steps
117-
- name: Set Git To Use LF
118-
run: |
119-
git config --global core.autocrlf false
120-
git config --global core.eol lf
121-
- name: Checkout
122-
uses: actions/checkout@v2
123-
124-
# Install PHP Dependencies
125-
- name: Setup PHP ${{ matrix.php }}
126-
uses: shivammathur/setup-php@v2
127-
with:
128-
php-version: ${{ matrix.php }}
129-
- name: Validate Composer
130-
run: composer validate
131-
- name: Get Composer Cache Directory
132-
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
133-
id: composer-cache
134-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
135-
- name: Restore Composer Cache
136-
uses: actions/cache@v1
137-
with:
138-
path: ${{ steps.composer-cache.outputs.dir }}
139-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
140-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
141-
- name: Install Dependencies
142-
uses: nick-invision/retry@v1
143-
with:
144-
timeout_minutes: 5
145-
max_attempts: 5
146-
command: composer update --prefer-dist --no-interaction --no-progress
147-
148-
# Execution
149-
- name: Check Coding Standards
150-
run: vendor/bin/phpcs --standard=phpcs.xml
151-
152-
test:
153-
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
154-
runs-on: ${{ matrix.os }}
155-
156-
strategy:
157-
fail-fast: false
158-
matrix:
159-
php: [ '7.4', '8.0', '8.1' ]
160-
os: [ ubuntu-latest, macos-latest, windows-latest ]
161-
stability: [ prefer-lowest, prefer-stable ]
162-
163-
steps: # General Steps
164-
- name: Set Git To Use LF
165-
run: |
166-
git config --global core.autocrlf false
167-
git config --global core.eol lf
168-
- name: Checkout
169-
uses: actions/checkout@v2
170-
171-
# Install PHP Dependencies
172-
- name: Setup PHP ${{ matrix.php }}
173-
uses: shivammathur/setup-php@v2
174-
with:
175-
php-version: ${{ matrix.php }}
176-
# PHP Extras
177-
coverage: pcov
178-
tools: pecl
179-
ini-values: "memory_limit=-1"
180-
- name: Validate Composer
181-
run: composer validate
182-
- name: Get Composer Cache Directory
183-
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
184-
id: composer-cache
185-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
186-
- name: Restore Composer Cache
187-
uses: actions/cache@v1
188-
with:
189-
path: ${{ steps.composer-cache.outputs.dir }}
190-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
191-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
192-
- name: Install Dependencies
193-
uses: nick-invision/retry@v1
194-
with:
195-
timeout_minutes: 5
196-
max_attempts: 5
197-
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
198-
199-
# Execution
200-
- name: Execute Tests
201-
run: vendor/bin/phpunit
8+
tests:
9+
name: Unit Tests (${{matrix.php}}-${{matrix.ts}}, ${{ matrix.os }}, ${{ matrix.stability }})
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
15+
ts: [ 'ts', 'nts' ]
16+
os: [ ubuntu-latest, macos-latest, windows-latest ]
17+
stability: [ prefer-lowest, prefer-stable ]
18+
steps:
19+
- name: Checkout
20+
uses: actions/[email protected]
21+
- name: Setup PHP ${{ matrix.php }}
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
tools: composer:v2
26+
ini-values: ffi.enable=1
27+
extensions: ffi
28+
env:
29+
phpts: ${{ matrix.ts }}
30+
- name: Validate Composer
31+
run: composer validate
32+
- name: Install Dependencies
33+
uses: nick-invision/retry@v2
34+
with:
35+
timeout_minutes: 5
36+
max_attempts: 5
37+
command: composer update --prefer-dist --no-interaction --no-progress
38+
- name: Execute Tests
39+
run: composer test

.github/workflows/security.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: security
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
security:
11+
name: Security
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [ '8.3' ]
17+
os: [ ubuntu-latest ]
18+
steps:
19+
- name: Set Git To Use LF
20+
run: |
21+
git config --global core.autocrlf false
22+
git config --global core.eol lf
23+
- name: Checkout
24+
uses: actions/[email protected]
25+
- name: Setup PHP ${{ matrix.php }}
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
- name: Validate Composer
30+
run: composer validate
31+
- name: Install Dependencies
32+
uses: nick-invision/retry@v2
33+
with:
34+
timeout_minutes: 5
35+
max_attempts: 5
36+
command: composer update --prefer-dist --no-interaction --no-progress
37+
- name: Composer Audit
38+
run: composer audit
39+
- name: Security Advisories
40+
run: composer require --dev roave/security-advisories:dev-latest

.github/workflows/static-analysis.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: static-analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
psalm:
9+
name: Psalm
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.3' ]
15+
os: [ ubuntu-latest ]
16+
steps:
17+
- name: Set Git To Use LF
18+
run: |
19+
git config --global core.autocrlf false
20+
git config --global core.eol lf
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
- name: Setup PHP ${{ matrix.php }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
- name: Validate Composer
28+
run: composer validate
29+
- name: Install Dependencies
30+
uses: nick-invision/retry@v2
31+
with:
32+
timeout_minutes: 5
33+
max_attempts: 5
34+
command: composer update --prefer-dist --no-interaction --no-progress
35+
- name: Static Analysis
36+
run: composer linter

0 commit comments

Comments
 (0)