Kint_Object_Throwable::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.2
c 0
b 0
f 0
1
<?php
2
3
class Kint_Object_Throwable extends Kint_Object_Instance
0 ignored issues
show
Coding Style introduced by
Kint_Object_Throwable does not seem to conform to the naming convention (^[A-Z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
4
{
5
    public $message;
6
    public $hints = array('object', 'throwable');
7
8
    public function __construct($throw)
9
    {
10
        if (!$throw instanceof Exception && (!KINT_PHP70 || !$throw instanceof Throwable)) {
11
            throw new InvalidArgumentException('Kint_Object_Throwable must be constructed with an Exception or a Throwable');
12
        }
13
14
        $this->message = $throw->getMessage();
15
    }
16
17
    public function getValueShort()
18
    {
19
        if (strlen($this->message)) {
20
            return '"'.$this->message.'"';
21
        }
22
    }
23
}
24