GeneralErrorHandler::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: afshin
5
 * Date: 11/20/17
6
 * Time: 6:55 PM
7
 */
8
9
namespace Core\Handlers;
10
11
12
use Core\Interfaces\_ErrorHandler;
13
14
class GeneralErrorHandler extends _ErrorHandler
15
{
16
    public function __invoke($request, $response, $exception) {
17
        return $response
18
            ->withStatus(500)
19
            ->withHeader('Content-Type', 'text/html')
20
            ->write('Something went wrong!');
21
    }
22
}
23
24