Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 11, 2023
1 parent 83aeb2d commit 63bee8b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
testsuite:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

validation:
name: Coding Standard & Static Analysis
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v1
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[![CI](https://github.com/dereuromark/cakephp-whoops/workflows/CI/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-whoops/actions?query=workflow%3ACI+branch%3Amaster)
[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-whoops/d/total.svg)](https://packagist.org/packages/dereuromark/cakephp-whoops)
# Whoops for CakePHP

[![CI](https://github.com/dereuromark/cakephp-whoops/workflows/CI/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-whoops/actions?query=workflow%3ACI+branch%3Amaster)
[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-whoops/d/total.svg)](https://packagist.org/packages/dereuromark/cakephp-whoops)
[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-whoops/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-whoops)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://packagist.org/packages/dereuromark/cakephp-whoops)

# Whoops for CakePHP

Seamlessly integrate [Whoops] into [CakePHP] applications.

Demo-Video: [Linux Mint + Firefox](https://streamable.com/s/h63t3/xweicf)

This branch is for use with **CakePHP 4.2+**. For details see [version map](https://github.com/dereuromark/cakephp-whoops/wiki#cakephp-version-map).

## Install

Using [Composer]:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"source": "https://github.com/dereuromark/cakephp-whoops"
},
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0",
"php": ">=7.4",
"cakephp/cakephp": "^4.2",
"filp/whoops": "^2.0"
},
"require-dev": {
Expand All @@ -45,10 +45,10 @@
},
"scripts": {
"test": "php phpunit.phar",
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-8.5.13.phar && mv phpunit-8.5.13.phar phpunit.phar || true",
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-9.5.13.phar && mv phpunit-9.5.13.phar phpunit.phar || true",
"test-coverage" : "php phpunit.phar --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml",
"stan": "phpstan analyse",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.0.0 && mv composer.backup composer.json",
"cs-check": "phpcs -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --extensions=php src/ tests/",
"cs-fix": "phpcbf -v --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --extensions=php src/ tests/"
},
Expand Down
3 changes: 3 additions & 0 deletions src/Error/Middleware/WhoopsHandlerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class WhoopsHandlerMiddleware extends ErrorHandlerMiddleware {

use WhoopsTrait;

/**
* @var string
*/
public const PHP_SAPI_CLI = 'cli';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Error/WhoopsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace CakephpWhoops\Error;

use Cake\Core\Configure;
use Cake\Core\Exception\Exception as CakeException;
use Cake\Core\Exception\CakeException;
use Cake\Error\ErrorHandler;
use Cake\Http\ServerRequest;
use Cake\Routing\Router;
Expand Down
4 changes: 2 additions & 2 deletions src/Error/WhoopsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
trait WhoopsTrait {

/**
* @var \Whoops\Run
* @var \Whoops\Run|null
*/
protected $_whoops;

/**
* @return \Whoops\Run
*/
protected function getWhoopsInstance(): Run {
if (empty($this->_whoops)) {
if ($this->_whoops === null) {
$this->_whoops = new Run();
}

Expand Down

0 comments on commit 63bee8b

Please sign in to comment.