Exception   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
c 2
b 1
f 0
lcom 0
cbo 0
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 4
1
<?php
2
3
/*
4
 * This file is part of the Rutube PHP API Client package.
5
 *
6
 * (c) Rutube
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Rutube\Exceptions;
13
14
/**
15
 * Class Exception
16
 * @package Rutube\Exceptions
17
 */
18
class Exception extends \Exception
19
{
20
    /**
21
     * @param string $message
22
     * @param int $code
23
     * @param Exception $previous
24
     */
25
    public function __construct($message = '', $code = 0, Exception $previous = null)
26
    {
27
        if (is_object($message)) {
28
            $message = (array)$message;
29
        }
30
31
        if (is_array($message)) {
32
            $message = json_encode($message);
33
        }
34
35
        if (empty($message)) {
36
            $message = $this->message;
37
        }
38
39
        parent::__construct($message, $code, $previous);
40
    }
41
}
42