ExceptionSynopsis::getDetails()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TheIconic\Synopsis;
4
5
use TheIconic\Synopsis\Exception\TraceSynopsis;
6
7
/**
8
 * represents and exception
9
 *
10
 * @package TheIconic\Synopsis
11
 */
12
class ExceptionSynopsis extends ObjectSynopsis
13
{
14
    /**
15
     * @var string the file
16
     */
17
    protected $file;
18
19
    /**
20
     * @var int the line
21
     */
22
    protected $line;
23
24
    /**
25
     * @see parent::process()
26
     * @param $value
27
     * @param $depth
28
     */
29
    public function process($value, $depth)
30
    {
31
        parent::process($value, $depth);
32
33
        $this->length = count($value->getTrace());
34
35
        $this->value = $value->getMessage();
36
37
        $this->line = $value->getLine();
38
39
        $this->file = $value->getFile();
40
41
        // we omit the $depth check here on purpose
42
        foreach ($value->getTrace() as $k => $trace) {
43
            $child = new TraceSynopsis();
44
            $child->setFactory($this->getFactory());
45
            $child->process($trace, $depth);
46
            $this->addChild($child, '#' . $k);
47
        }
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getDetails()
54
    {
55
        return [
56
            'line' => $this->line,
57
            'file' => $this->file,
58
        ];
59
    }
60
}
61