SaitoBlackholeException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace Saito\Exception;
14
15
use Cake\Http\Exception\BadRequestException;
16
use Saito\Exception\Logger\ExceptionLogger;
17
18
class SaitoBlackholeException extends BadRequestException
19
{
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function __construct($type = null, $data = [])
24
    {
25
        $message = 'Request was blackholed. Type: ' . $type;
26
        $logger = new ExceptionLogger();
27
        $logger->write($message, $data);
28
        parent::__construct($message, 400);
29
    }
30
}
31