ErrorCollection::addError()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace LimeSoda\LiveGuard;
4
use LimeSoda\LiveGuard\Error;
5
6
/**
7
 * Class ErrorCollection
8
 * @package LimeSoda\LiveGuard
9
 */
10
class ErrorCollection
11
{
12
13
    protected $_exceptions = array();
14
15
    /**
16
     * @param \Exception $exception
17
     */
18
    public function addError( \Exception $exception )
19
    {
20
        $this->_exceptions[] = new Error($exception);
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function getErrors()
27
    {
28
        return $this->_exceptions;
29
    }
30
31
    /**
32
     * @return int
33
     */
34
    public function countErrors()
35
    {
36
        return count($this->_exceptions);
37
    }
38
}
39