InvalidValueException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 2
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\Platfourm\Foundation\Exceptions;
12
13
use Symfony\Component\HttpKernel\Exception\HttpException;
14
15
class InvalidValueException extends HttpException
16
{
17
18
    public function __construct(
19
        $message = null,
20
        $statusCode = 400,
21
        \Exception $previous = null,
22
        array $headers = [],
23
        $code = 0
24
    ) {
25
        if (empty($message)) {
26
            $trace   = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);
27
            $message = '"invalid value on ' . $trace[0]['file'] . ' line ' . $trace[0]['line'] . '"';
28
        } else {
29
            $message = '"' . $message . '"';
30
        }
31
        parent::__construct($statusCode, $message, $previous, $headers, $code);
32
    }
33
}
34