EwarehousingException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 8
c 2
b 0
f 1
dl 0
loc 35
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getChilds() 0 3 1
A hasChilds() 0 3 1
A addChild() 0 5 1
A clearChilds() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of PHP CS Fixer.
5
 *
6
 * (c) Fabien Potencier <[email protected]>
7
 *     Dariusz Rumiński <[email protected]>
8
 *
9
 * This source file is subject to the MIT license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Etrias\EwarehousingConnector\Exceptions;
14
15
use Exception;
16
use Throwable;
17
18
class EwarehousingException extends Exception
19
{
20
    /** @var Throwable[] */
21
    protected $childErrors = [];
22
23
    /**
24
     * @param Throwable $throwable
25
     *
26
     * @return $this
27
     */
28
    public function addChild(Throwable $throwable)
29
    {
30
        $this->childErrors[] = $throwable;
31
32
        return $this;
33
    }
34
35
    /**
36
     * @return $this
37
     */
38
    public function clearChilds()
39
    {
40
        $this->childErrors = [];
41
42
        return $this;
43
    }
44
45
    public function getChilds()
46
    {
47
        return $this->childErrors;
48
    }
49
50
    public function hasChilds()
51
    {
52
        return count($this->childErrors) > 0;
53
    }
54
}
55