ExecutionResult::getUuid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright 2014 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\StepupMiddlewareClient\Service;
20
21
class ExecutionResult
22
{
23
    /**
24
     * @var string|null
25
     */
26
    private $uuid;
27
28
    /**
29
     * @var null|string
30
     */
31
    private $processedBy;
32
33
    /**
34
     * @var string[]
35
     */
36
    private $errors;
37
38
    /**
39
     * @param string|null $uuid Null in case of errors.
40
     * @param string|null $processedBy Null in case of errors.
41
     * @param array $errors
42
     */
43
    public function __construct($uuid, $processedBy, array $errors = [])
44
    {
45
        $this->uuid = $uuid;
46
        $this->processedBy = $processedBy;
47
        $this->errors = $errors;
48
    }
49
50
    /**
51
     * @return string|null Null in case of errors.
52
     */
53
    public function getUuid()
54
    {
55
        return $this->uuid;
56
    }
57
58
    /**
59
     * @return null|string Null in case of errors.
60
     */
61
    public function getProcessedBy()
62
    {
63
        return $this->processedBy;
64
    }
65
66
    /**
67
     * @return bool False in case of errors.
68
     */
69
    public function isSuccessful()
70
    {
71
        return count($this->errors) === 0;
72
    }
73
74
    /**
75
     * @return string[]
76
     */
77
    public function getErrors()
78
    {
79
        return $this->errors;
80
    }
81
}
82