Skip to content

Commit

Permalink
Merge pull request #4 from designcise/4.x
Browse files Browse the repository at this point in the history
feat: php version bump to 8.2
  • Loading branch information
designcise authored Jul 1, 2023
2 parents 60c91de + b306b90 commit 289ed6d
Show file tree
Hide file tree
Showing 30 changed files with 3,411 additions and 96 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/phpstan.neon export-ignore
/test export-ignore
/test export-ignore
2 changes: 2 additions & 0 deletions .github/scripts/run-phpunit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
composer test-report
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: Install dependencies
uses: php-actions/composer@v6
with:
version: 2.5.5

- name: Test & Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 8e4ebac75b8e3db612b64b61e1109d876cb5b330b2c844202f890d7ae70e3d45
with:
coverageCommand: ./.github/scripts/run-phpunit.sh
coverageLocations: coverage.xml:clover
debug: true

- name: Clean up GitHub workspace
uses: docker://ubuntu:latest
with:
args: find /github/workspace/. -name . -o -prune -exec rm -rf -- {} +
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
/.idea
.DS_Store
*.cache
composer.lock
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Portions of the "BitFrame Whoops Middleware" incorporates the work by (as provid

All other copyright for the "BitFrame Whoops Middleware" are held by:

* Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
* Copyright (c) 2017-2023 Daniyal Hamid (https://designcise.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# BitFrame\Whoops

[![codecov](https://codecov.io/gh/designcise/bitframe-whoops/branch/master/graph/badge.svg)](https://codecov.io/gh/designcise/bitframe-whoops)
[![Build Status](https://travis-ci.com/designcise/bitframe-whoops.svg?branch=master)](https://travis-ci.com/designcise/bitframe-whoops)
[![CI](https://github.com/designcise/bitframe-whoops/actions/workflows/ci.yml/badge.svg)](https://github.com/designcise/bitframe-whoops/actions/workflows/ci.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/1a7ef1d3db6876f86eb5/maintainability)](https://codeclimate.com/github/designcise/bitframe-whoops/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/1a7ef1d3db6876f86eb5/test_coverage)](https://codeclimate.com/github/designcise/bitframe-whoops/test_coverage)

Whoops error handler middleware to handle application or middleware specific errors.

Expand All @@ -11,7 +12,7 @@ Whoops error handler middleware to handle application or middleware specific err
$ composer require "designcise/bitframe-whoops"
```

Please note that this package requires PHP 8.1.0 or newer.
Please note that this package requires PHP 8.2.0 or newer.

## Quickstart

Expand All @@ -21,9 +22,9 @@ The constructor has the following signature:

```php
new ErrorHandler(
\Psr\Http\Message\ResponseFactoryInterface,
\BitFrame\Whoops\Provider\HandlerProviderNegotiator::class
[options]
ResponseFactoryInterface,
HandlerProviderNegotiator::class,
[options],
);
```

Expand Down Expand Up @@ -88,7 +89,7 @@ throw new \Exception('hello world!');

### How Does It Work?

The error handler middleware automatically determines the error handler to use based on the `Accept` header. The following error handler provders are included:
The error handler middleware automatically determines the error handler to use based on the `Accept` header. The following error handler providers are included:

1. `BitFrame\Whoops\Provider\HtmlHandlerProvider` for `Whoops\Handler\PrettyPageHandler`;
1. `BitFrame\Whoops\Provider\JsonHandlerProvider` for `Whoops\Handler\JsonResponseHandler`;
Expand Down Expand Up @@ -118,4 +119,4 @@ Complete documentation for v3 will be available soon.

## License

Please see [License File](LICENSE.md) for licensing information.
Please see [License File](LICENSE.md) for licensing information.
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
}
],
"require": {
"php": ">=8.1",
"filp/whoops": "~2.14",
"psr/http-factory": "~1.0",
"psr/http-server-handler": "~1.0",
"psr/http-server-middleware": "~1.0"
"php": ">=8.2",
"filp/whoops": "^2.15",
"psr/http-factory": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand All @@ -28,7 +28,8 @@
"style-fix": "vendor/bin/phpcbf --standard=PSR12 src",
"check": "vendor/bin/phpstan analyse src --level=5 -c phpstan.neon",
"md": "vendor/bin/phpmd src text cleancode,unusedcode,codesize,design,naming",
"test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe_whoops"
"test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe_whoops",
"test-report": "vendor/bin/phpunit --configuration phpunit.xml --testsuite bitframe_whoops --coverage-clover=coverage.xml"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 289ed6d

Please sign in to comment.