SFBatchErrors::setBatchInfo()   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 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace SalesforceBulkApi\objects;
4
5
use SalesforceBulkApi\dto\BatchInfoDto;
6
7
class SFBatchErrors
8
{
9
    /**
10
     * @var BatchInfoDto
11
     */
12
    private $batchInfo;
13
14
    /**
15
     * @var int[]
16
     */
17
    private $errorNumbers;
18
19
    /**
20
     * @var string[]
21
     */
22
    private $errorMessages;
23
24
    /**
25
     * @param int    $number
26
     * @param string $message
27
     *
28
     * @return $this
29
     */
30
    public function addError($number, $message)
31
    {
32
        $this->errorNumbers[]  = $number;
33
        $this->errorMessages[] = $message;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @return BatchInfoDto
40
     */
41
    public function getBatchInfo()
42
    {
43
        return $this->batchInfo;
44
    }
45
46
    /**
47
     * @return \int[]
48
     */
49
    public function getErrorNumbers()
50
    {
51
        return $this->errorNumbers;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->errorNumbers returns the type integer[] which is incompatible with the documented return type int[].
Loading history...
52
    }
53
54
    /**
55
     * @return \string[]
56
     */
57
    public function getErrorMessages()
58
    {
59
        return $this->errorMessages;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->errorMessages returns the type string[] which is incompatible with the documented return type string[].
Loading history...
60
    }
61
62
    /**
63
     * @param BatchInfoDto $batchInfo
64
     *
65
     * @return $this
66
     */
67
    public function setBatchInfo($batchInfo)
68
    {
69
        $this->batchInfo = $batchInfo;
70
        return $this;
71
    }
72
}