Skip to content

Commit

Permalink
Add PHP 8.2 support (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored Jan 4, 2023
1 parent 3bed28f commit 0e8a6cf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 50 deletions.
19 changes: 10 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/.github export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php-cs-fixer.php export-ignore
Makefile export-ignore
composer-require-checker.json export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
/.github export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore
/Makefile export-ignore
/composer-require-checker.json export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
30 changes: 10 additions & 20 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v3.2.2
uses: "actions/cache@v3"
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down Expand Up @@ -62,12 +62,12 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
code-coverage:
- "pcov"
# include:
# - php-version: "8.1"
# code-coverage: "pcov"
- "none"
include:
- php-version: "8.1"
code-coverage: "pcov"


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

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

- name: "Send code coverage report to Codecov.io"
if: ${{ matrix.code-coverage != 'none' }}
uses: codecov/codecov-action@v3.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
fail_ci_if_error: true

coding-standards:
name: "Coding Standards"

Expand All @@ -132,14 +124,13 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: cs2pr

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

- name: "Cache dependencies"
uses: actions/cache@v3.2.2
uses: "actions/cache@v3"
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down Expand Up @@ -171,14 +162,13 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1
tools: cs2pr

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

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

- name: "Run static analysis"
run: "vendor/bin/phpstan analyse --no-progress"
run: "vendor/bin/phpstan analyse --no-progress --error-format=github"
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ all: csfix static-analysis test

vendor: composer.json
composer update
composer bump
touch vendor

.PHONY: csfix
Expand All @@ -11,7 +12,7 @@ csfix: vendor

.PHONY: static-analysis
static-analysis: vendor
vendor/bin/phpstan analyse
php -d zend.assertions=1 vendor/bin/phpstan analyse

.PHONY: test
test: vendor
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

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

Crappy class to manage errors and exceptions
25 changes: 7 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
}
],
"require": {
"php": "~8.1.0"
"php": "~8.1.0 || ~8.2.0"
},
"require-dev": {
"malukenho/mcbumpface": "^1.1.5",
"phpstan/phpstan": "^1.8.2",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpunit/phpunit": "^9.5.21",
"slam/php-cs-fixer-extensions": "^3.2.1",
"phpstan/phpstan": "^1.9.6",
"phpstan/phpstan-phpunit": "^1.3.3",
"phpstan/phpstan-strict-rules": "^1.4.4",
"phpunit/phpunit": "^9.5.27",
"slam/php-cs-fixer-extensions": "^3.3",
"slam/php-debug-r": "^1.7.0",
"symfony/console": "^6.1.2"
"symfony/console": "^6.2.3"
},
"autoload": {
"psr-4": {
Expand All @@ -32,15 +31,5 @@
"psr-4": {
"SlamTest\\ErrorHandler\\": "tests/"
}
},
"config": {
"allow-plugins": {
"malukenho/mcbumpface": true
}
},
"extra": {
"mc-bumpface": {
"stripVersionPrefixes": true
}
}
}
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotFalse\\(\\) with false will always evaluate to false\\.$#"
count: 1
path: tests/ErrorHandlerTest.php

-
message: "#^Expression \"\\$arrayPerVerificaErrori\\['undefined_index'\\]\" on a separate line does not do anything\\.$#"
count: 1
Expand Down
3 changes: 2 additions & 1 deletion tests/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function testDefaultConfiguration(): void

/**
* @runInSeparateProcess
*
* @preserveGlobalState disabled
*/
public function testRegisterBuiltinHandlers(): void
Expand All @@ -95,6 +96,7 @@ public function testRegisterBuiltinHandlers(): void

/**
* @runInSeparateProcess
*
* @preserveGlobalState disabled
*/
public function testScream(): void
Expand Down Expand Up @@ -225,7 +227,6 @@ public function testCanHideVariablesFromEmail(): void

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

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

0 comments on commit 0e8a6cf

Please sign in to comment.