Skip to content

Commit d8b16a9

Browse files
Fix comment in example code in README
The comment claims that the ErrorHandler falls back to the PlainFormatter, when no Formatter matches the request, but that is not true. It falls back to the first formatter in the list. When you do not supply any formatters to the constructor the default list of formatters indeed starts with the PlainFormatter, but that is not what happens in the example.
1 parent 87ed914 commit d8b16a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use Middlewares\Utils\Dispatcher;
3131

3232
// Create a new ErrorHandler instance
3333
// Any number of formatters can be added. One will be picked based on the Accept
34-
// header of the request. If no formatter matches, the PlainFormatter will be used.
34+
// header of the request. If no formatter matches, the first formatter in the array
35+
// will be used.
3536
$errorHandler = new ErrorHandler([
3637
new ErrorFormatter\HtmlFormatter(),
3738
new ErrorFormatter\ImageFormatter(),

0 commit comments

Comments
 (0)