EwarehousingException::hasChilds()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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