Completed
Push — master ( ce1278...2488b5 )
by Nate
05:22 queued 04:08
created

Collection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setErrors() 0 7 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/salesforce/blob/master/LICENSE.md
6
 * @link       https://github.com/flipbox/salesforce
7
 */
8
9
namespace Flipbox\Salesforce\Collections;
10
11
use Flipbox\Skeleton\Collections\Collection as BaseCollection;
12
use Flipbox\Skeleton\Error\ErrorInterface;
13
use Flipbox\Skeleton\Error\ErrorTrait;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 2.1.0
18
 */
19
class Collection extends BaseCollection implements ErrorInterface
20
{
21
    use ErrorTrait;
22
23
    /**
24
     * Errors may be transformed and passed in the constructor config
25
     *
26
     * @param array $errors
27
     * @return $this
28
     */
29
    public function setErrors(array $errors)
30
    {
31
        foreach ($errors as $key => $error) {
32
            $this->addError($key, $error);
33
        }
34
        return $this;
35
    }
36
}
37