Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cake5' into pr/13
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	README.md
#	composer.json
#	src/Error/WhoopsHandler.php
#	src/Error/WhoopsTrait.php
  • Loading branch information
dereuromark committed Oct 11, 2023
2 parents a97de0f + bba5d85 commit 848598e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 32 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@ name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
testsuite:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4']
php-version: ['8.1', '8.2']
prefer-lowest: ['']
include:
- php-version: '7.2'
- php-version: '8.1'
prefer-lowest: 'prefer-lowest'

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -44,7 +41,7 @@ jobs:
- name: Composer install --no-progress --prefer-dist --optimize-autoloader
run: |
composer --version
composer require --dev phpunit/phpunit:"^8.5"
composer require --dev phpunit/phpunit:"^9.5"
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}
then
composer update --prefer-lowest --prefer-stable
Expand All @@ -54,7 +51,7 @@ jobs:
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then composer require --dev dereuromark/composer-prefer-lowest:dev-master; fi
- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '7.4' ]]
if [[ ${{ matrix.php-version }} == '8.1' ]]
then
vendor/bin/phpunit --coverage-clover=coverage.xml
else
Expand All @@ -64,22 +61,20 @@ jobs:
run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi

- name: Code Coverage Report
if: success() && matrix.php-version == '7.4'
if: success() && matrix.php-version == '8.1'
uses: codecov/codecov-action@v1

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

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring, intl
coverage: none

Expand Down
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/composer.lock
/phpunit.phar
/vendor/
/tmp/
/composer.phar
/.idea
/.phpunit.cache
composer.lock
phpunit.phar
.phpunit.result.cache
.phpunit.cache/
vendor/
tmp/
composer.phar
.idea/
nbproject/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2717 Mark Scherer
Copyright (c) 2017 Mark Scherer
Copyright (c) 2014 Jad Bitar

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# 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%208.1-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 5.0+**. For details see [version map](https://github.com/dereuromark/cakephp-whoops/wiki#cakephp-version-map).

## Install

Using [Composer]:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"filp/whoops": "^2.0"
},
"require-dev": {
"fig-r/psr2r-sniffer": "dev-master",
"phpunit/phpunit": "^10.1"
"phpunit/phpunit": "^10.1",
"fig-r/psr2r-sniffer": "dev-master"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</php>
<testsuites>
<testsuite name="whoops">
<directory>tests/</directory>
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>
<source>
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,13 +10,13 @@

trait WhoopsTrait {

protected Run $_whoops;
protected ?Run $_whoops = null;

/**
* @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 848598e

Please sign in to comment.