Skip to content

Commit 0e8a6cf

Browse files
authored
Add PHP 8.2 support (#30)
1 parent 3bed28f commit 0e8a6cf

File tree

7 files changed

+36
-50
lines changed

7 files changed

+36
-50
lines changed

.gitattributes

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
/.github export-ignore
2-
/tests export-ignore
3-
.gitattributes export-ignore
4-
.gitignore export-ignore
5-
.php-cs-fixer.php export-ignore
6-
Makefile export-ignore
7-
composer-require-checker.json export-ignore
8-
phpstan.neon export-ignore
9-
phpunit.xml export-ignore
1+
/.github export-ignore
2+
/tests export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/.php-cs-fixer.php export-ignore
6+
/Makefile export-ignore
7+
/composer-require-checker.json export-ignore
8+
/phpstan-baseline.neon export-ignore
9+
/phpstan.neon export-ignore
10+
/phpunit.xml export-ignore

.github/workflows/integrate.yaml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
3434

3535
- name: "Cache dependencies"
36-
uses: actions/cache@v3.2.2
36+
uses: "actions/cache@v3"
3737
with:
3838
path: ${{ steps.composercache.outputs.dir }}
3939
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
@@ -62,12 +62,12 @@ jobs:
6262
strategy:
6363
matrix:
6464
php-version:
65-
- "8.1"
65+
- "8.2"
6666
code-coverage:
67-
- "pcov"
68-
# include:
69-
# - php-version: "8.1"
70-
# code-coverage: "pcov"
67+
- "none"
68+
include:
69+
- php-version: "8.1"
70+
code-coverage: "pcov"
7171

7272

7373
steps:
@@ -86,7 +86,7 @@ jobs:
8686
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
8787

8888
- name: "Cache dependencies"
89-
uses: actions/cache@v3.2.2
89+
uses: "actions/cache@v3"
9090
with:
9191
path: ${{ steps.composercache.outputs.dir }}
9292
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
@@ -105,14 +105,6 @@ jobs:
105105
timeout-minutes: 1
106106
run: "vendor/bin/phpunit"
107107

108-
- name: "Send code coverage report to Codecov.io"
109-
if: ${{ matrix.code-coverage != 'none' }}
110-
uses: codecov/codecov-action@v3.1.1
111-
with:
112-
token: ${{ secrets.CODECOV_TOKEN }}
113-
file: ./coverage/clover.xml
114-
fail_ci_if_error: true
115-
116108
coding-standards:
117109
name: "Coding Standards"
118110

@@ -132,14 +124,13 @@ jobs:
132124
with:
133125
coverage: "none"
134126
php-version: "${{ matrix.php-version }}"
135-
tools: cs2pr
136127

137128
- name: "Get composer cache directory"
138129
id: composercache
139130
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
140131

141132
- name: "Cache dependencies"
142-
uses: actions/cache@v3.2.2
133+
uses: "actions/cache@v3"
143134
with:
144135
path: ${{ steps.composercache.outputs.dir }}
145136
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
@@ -171,14 +162,13 @@ jobs:
171162
coverage: "none"
172163
php-version: "${{ matrix.php-version }}"
173164
ini-values: zend.assertions=1
174-
tools: cs2pr
175165

176166
- name: "Get composer cache directory"
177167
id: composercache
178168
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
179169

180170
- name: "Cache dependencies"
181-
uses: actions/cache@v3.2.2
171+
uses: "actions/cache@v3"
182172
with:
183173
path: ${{ steps.composercache.outputs.dir }}
184174
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
@@ -188,4 +178,4 @@ jobs:
188178
run: "composer update --no-interaction --no-progress"
189179

190180
- name: "Run static analysis"
191-
run: "vendor/bin/phpstan analyse --no-progress"
181+
run: "vendor/bin/phpstan analyse --no-progress --error-format=github"

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ all: csfix static-analysis test
33

44
vendor: composer.json
55
composer update
6+
composer bump
67
touch vendor
78

89
.PHONY: csfix
@@ -11,7 +12,7 @@ csfix: vendor
1112

1213
.PHONY: static-analysis
1314
static-analysis: vendor
14-
vendor/bin/phpstan analyse
15+
php -d zend.assertions=1 vendor/bin/phpstan analyse
1516

1617
.PHONY: test
1718
test: vendor

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
[![Latest Stable Version](https://img.shields.io/packagist/v/slam/php-errorhandler-legacy.svg)](https://packagist.org/packages/slam/php-errorhandler-legacy)
44
[![Integrate](https://github.com/Slamdunk/php-errorhandler-legacy/workflows/Integrate/badge.svg?branch=master)](https://github.com/Slamdunk/php-errorhandler-legacy/actions)
5-
[![Code Coverage](https://codecov.io/gh/Slamdunk/php-errorhandler-legacy/coverage.svg?branch=master)](https://codecov.io/gh/Slamdunk/php-errorhandler-legacy?branch=master)
65

76
Crappy class to manage errors and exceptions

composer.json

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111
}
1212
],
1313
"require": {
14-
"php": "~8.1.0"
14+
"php": "~8.1.0 || ~8.2.0"
1515
},
1616
"require-dev": {
17-
"malukenho/mcbumpface": "^1.1.5",
18-
"phpstan/phpstan": "^1.8.2",
19-
"phpstan/phpstan-phpunit": "^1.1.1",
20-
"phpstan/phpstan-strict-rules": "^1.3.0",
21-
"phpunit/phpunit": "^9.5.21",
22-
"slam/php-cs-fixer-extensions": "^3.2.1",
17+
"phpstan/phpstan": "^1.9.6",
18+
"phpstan/phpstan-phpunit": "^1.3.3",
19+
"phpstan/phpstan-strict-rules": "^1.4.4",
20+
"phpunit/phpunit": "^9.5.27",
21+
"slam/php-cs-fixer-extensions": "^3.3",
2322
"slam/php-debug-r": "^1.7.0",
24-
"symfony/console": "^6.1.2"
23+
"symfony/console": "^6.2.3"
2524
},
2625
"autoload": {
2726
"psr-4": {
@@ -32,15 +31,5 @@
3231
"psr-4": {
3332
"SlamTest\\ErrorHandler\\": "tests/"
3433
}
35-
},
36-
"config": {
37-
"allow-plugins": {
38-
"malukenho/mcbumpface": true
39-
}
40-
},
41-
"extra": {
42-
"mc-bumpface": {
43-
"stripVersionPrefixes": true
44-
}
4534
}
4635
}

phpstan-baseline.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotFalse\\(\\) with false will always evaluate to false\\.$#"
5+
count: 1
6+
path: tests/ErrorHandlerTest.php
7+
38
-
49
message: "#^Expression \"\\$arrayPerVerificaErrori\\['undefined_index'\\]\" on a separate line does not do anything\\.$#"
510
count: 1

tests/ErrorHandlerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function testDefaultConfiguration(): void
8080

8181
/**
8282
* @runInSeparateProcess
83+
*
8384
* @preserveGlobalState disabled
8485
*/
8586
public function testRegisterBuiltinHandlers(): void
@@ -95,6 +96,7 @@ public function testRegisterBuiltinHandlers(): void
9596

9697
/**
9798
* @runInSeparateProcess
99+
*
98100
* @preserveGlobalState disabled
99101
*/
100102
public function testScream(): void
@@ -225,7 +227,6 @@ public function testCanHideVariablesFromEmail(): void
225227

226228
self::assertNotEmpty($this->emailsSent);
227229
$message = \current($this->emailsSent);
228-
self::assertNotFalse($message);
229230

230231
$messageText = $message['body'];
231232
self::assertStringContainsString($this->exception->getMessage(), $messageText);

0 commit comments

Comments
 (0)