Skip to content

Commit 082b3f1

Browse files
committed
Merge remote-tracking branch 'origin/simplify-error-log' into simplify-error-log
2 parents 2b56534 + 1f67374 commit 082b3f1

20 files changed

+254
-76
lines changed

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
os: >-
2121
['ubuntu-latest']
2222
php: >-
23-
['8.0']
23+
['8.3']

.github/workflows/static.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- 'phpunit.xml.dist'
1111

1212
push:
13+
branches: ['master']
1314
paths-ignore:
1415
- 'docs/**'
1516
- 'README.md'
@@ -28,4 +29,12 @@ jobs:
2829
os: >-
2930
['ubuntu-latest']
3031
php: >-
31-
['8.0', '8.1', '8.2']
32+
['8.1', '8.2', '8.3']
33+
psalm80:
34+
uses: yiisoft/actions/.github/workflows/psalm.yml@master
35+
with:
36+
psalm-config: psalm80.xml
37+
os: >-
38+
['ubuntu-latest']
39+
php: >-
40+
['8.0']

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
# Yii Error Handler Change Log
22

3-
## 3.1.0 under development
3+
## 3.2.2 under development
4+
5+
- no changes in this release.
6+
7+
## 3.2.1 March 07, 2024
8+
9+
- Enh #102: Add support for `psr/http-message` of `^2.0` version (@vjik)
10+
11+
## 3.2.0 January 30, 2024
12+
13+
- New #98: Add ability to execute `getBody()` on response when `ExceptionResponder` middleware is processing (@vjik)
14+
- Enh #96: Trace PHP errors (@xepozz, @vjik)
15+
16+
## 3.1.0 January 07, 2024
417

518
- New #87: Add `CompositeException` to be able to render multiple exceptions (@xepozz)
6-
- Bug #87: Fix a bug with try/finally from #75 (@xepozz)
719
- Chg #75: Dispatch `ApplicationError` in `ErrorCatcher` (@xepozz)
820
- Enh #82: Add `HeadersProvider` (@xepozz)
921
- Enh #86: Add color scheme definition based on system settings (@dood-)
22+
- Bug #87: Fix a bug with try/finally from #75 (@xepozz)
1023

1124
## 3.0.0 February 14, 2023
1225

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
1+
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://github.com/yiisoft" target="_blank">
3-
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px">
3+
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px" alt="Yii">
44
</a>
55
<h1 align="center">Yii Error Handler</h1>
66
<br>
@@ -21,7 +21,7 @@ The package provides advanced error handling. The features are:
2121
- Production and debug modes.
2222
- Debug mode displays details, stacktrace, has dark and light themes and handy buttons to search for error without typing.
2323
- Takes PHP settings into account.
24-
- Handles out of memory errors, fatals, warnings, notices and exceptions.
24+
- Handles out of memory errors, fatals, warnings, notices and exceptions.
2525
- Can use any PSR-3 compatible logger for error logging.
2626
- Detects response format based on mime type of the request.
2727
- Supports responding with HTML, plain text, JSON, XML and headers out of the box.
@@ -37,7 +37,7 @@ The package provides advanced error handling. The features are:
3737

3838
## Installation
3939

40-
The package could be installed with composer:
40+
The package could be installed with [Composer](https://getcomposer.org):
4141

4242
```shell
4343
composer require yiisoft/error-handler
@@ -195,9 +195,6 @@ $response = $exceptionResponder->process($request, $handler);
195195
In the application middleware stack `Yiisoft\ErrorHandler\Middleware\ExceptionResponder` must be placed before
196196
`Yiisoft\ErrorHandler\Middleware\ErrorCatcher`.
197197

198-
For use in the [Yii framework](https://www.yiiframework.com/),
199-
see [Yii guide to handling errors](https://github.com/yiisoft/docs/blob/master/guide/en/runtime/handling-errors.md).
200-
201198
## Events
202199

203200
- When `ErrorCatcher` catches an error it dispatches `\Yiisoft\ErrorHandler\Event\ApplicationError` event.
@@ -221,7 +218,6 @@ Code blocks in solution markdown support language syntax highlight:
221218

222219
For example:
223220

224-
````
225221
```html
226222
<html>
227223
<body>
@@ -230,38 +226,14 @@ For example:
230226
</body>
231227
</html>
232228
```
233-
````
234-
235-
## Testing
236-
237-
### Unit testing
238-
239-
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
240-
241-
```shell
242-
./vendor/bin/phpunit
243-
```
244-
245-
### Mutation testing
246-
247-
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
248-
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
249-
250-
```shell
251-
./vendor/bin/roave-infection-static-analysis-plugin
252-
```
253-
254-
### Static analysis
255229

256-
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
230+
## Documentation
257231

258-
```shell
259-
./vendor/bin/psalm
260-
```
232+
- [Yii guide to handling errors](https://github.com/yiisoft/docs/blob/master/guide/en/runtime/handling-errors.md)
233+
- [Internals](docs/internals.md)
261234

262-
## Credits
263-
264-
The Yii Error Handler use code of [Highlight.js](https://highlightjs.org/) by Ivan Sagalaev and other contributors.
235+
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
236+
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
265237

266238
## License
267239

@@ -270,6 +242,10 @@ Please see [`LICENSE`](./LICENSE.md) for more information.
270242

271243
Maintained by [Yii Software](https://www.yiiframework.com/).
272244

245+
## Credits
246+
247+
The Yii Error Handler use code of [Highlight.js](https://highlightjs.org/) by Ivan Sagalaev and other contributors.
248+
273249
## Support the project
274250

275251
[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)

UPGRADE.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

composer.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,22 @@
1414
"license": "BSD-3-Clause",
1515
"support": {
1616
"issues": "https://github.com/yiisoft/error-handler/issues?state=open",
17+
"source": "https://github.com/yiisoft/error-handler",
1718
"forum": "https://www.yiiframework.com/forum/",
1819
"wiki": "https://www.yiiframework.com/wiki/",
19-
"irc": "irc://irc.freenode.net/yii",
20-
"chat": "https://t.me/yii3en",
21-
"source": "https://github.com/yiisoft/error-handler"
20+
"irc": "ircs://irc.libera.chat:6697/yii",
21+
"chat": "https://t.me/yii3en"
2222
},
23+
"funding": [
24+
{
25+
"type": "opencollective",
26+
"url": "https://opencollective.com/yiisoft"
27+
},
28+
{
29+
"type": "github",
30+
"url": "https://github.com/sponsors/yiisoft"
31+
}
32+
],
2333
"require": {
2434
"php": "^8.0",
2535
"ext-dom": "*",
@@ -29,7 +39,7 @@
2939
"cebe/markdown": "^1.2",
3040
"psr/container": "^1.0|^2.0",
3141
"psr/http-factory": "^1.0",
32-
"psr/http-message": "^1.0",
42+
"psr/http-message": "^1.0|^2.0",
3343
"psr/http-server-handler": "^1.0",
3444
"psr/http-server-middleware": "^1.0",
3545
"psr/log": "^1.1|^2.0|^3.0",
@@ -41,10 +51,10 @@
4151
"httpsoft/http-message": "^1.0.9",
4252
"maglnet/composer-require-checker": "^4.4",
4353
"phpunit/phpunit": "^9.5",
44-
"rector/rector": "^0.18.3",
54+
"rector/rector": "^1.0",
4555
"roave/infection-static-analysis-plugin": "^1.16",
4656
"spatie/phpunit-watcher": "^1.23",
47-
"vimeo/psalm": "^4.30|^5.6",
57+
"vimeo/psalm": "^4.30|^5.20",
4858
"yiisoft/di": "^1.1",
4959
"yiisoft/test-support": "^1.3"
5060
},

docs/internals.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Internals
2+
3+
## Unit testing
4+
5+
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
6+
7+
```shell
8+
./vendor/bin/phpunit
9+
```
10+
11+
## Mutation testing
12+
13+
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
14+
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
15+
16+
```shell
17+
./vendor/bin/roave-infection-static-analysis-plugin
18+
```
19+
20+
## Static analysis
21+
22+
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
23+
24+
```shell
25+
./vendor/bin/psalm
26+
```
27+
28+
## Code style
29+
30+
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
31+
use either newest or any specific version of PHP:
32+
33+
```shell
34+
./vendor/bin/rector
35+
```
36+
37+
## Dependencies
38+
39+
This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if
40+
all dependencies are correctly defined in `composer.json`. To run the checker, execute the following command:
41+
42+
```shell
43+
./vendor/bin/composer-require-checker
44+
```

psalm.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,12 @@
99
>
1010
<projectFiles>
1111
<directory name="src" />
12+
<ignoreFiles>
13+
<directory name="vendor" />
14+
</ignoreFiles>
1215
</projectFiles>
16+
<issueHandlers>
17+
<MixedAssignment errorLevel="suppress" />
18+
<RiskyTruthyFalsyComparison errorLevel="suppress" />
19+
</issueHandlers>
1320
</psalm>

psalm80.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="1"
4+
findUnusedBaselineEntry="true"
5+
findUnusedCode="false"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xmlns="https://getpsalm.org/schema/config"
8+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
9+
>
10+
<projectFiles>
11+
<directory name="src" />
12+
<ignoreFiles>
13+
<directory name="vendor" />
14+
</ignoreFiles>
15+
</projectFiles>
16+
<issueHandlers>
17+
<MixedAssignment errorLevel="suppress" />
18+
</issueHandlers>
19+
</psalm>

0 commit comments

Comments
 (0)