ConfigLock::getRepositories()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: lhomza
5
 * Date: 1. 11. 2015
6
 * Time: 1:00
7
 */
8
9
namespace App\Satis\Model;
10
11
use Illuminate\Support\Collection;
12
use JMS\Serializer\Annotation\Type;
13
14
/**
15
 * @author Lukas Homza <[email protected]>
16
 */
17
class ConfigLock {
18
    /**
19
     * @Type("boolean")
20
     */
21
    private $locked;
22
23
    /**
24
     * @Type("string")
25
     */
26
    private $since;
27
28
    /**
29
     * @Type("array")
30
     */
31
    private $repositories;
32
33
    /**
34
     * @param $locked
35
     * @return $this
36
     */
37
    public function isLocked($locked = null) {
38
        if($locked === null) {
39
            return $this->locked;
40
        }
41
42
        $this->locked = $locked;
43
44
        return $this;
45
    }
46
47
    /**
48
     * @param $since
49
     * @return $this
50
     */
51
    public function since($since) {
52
        $this->since = $since;
53
54
        return $this;
55
    }
56
57
    /**
58
     * @param \Illuminate\Support\Collection $repositories
59
     * @return $this
60
     */
61
    public function by(Collection $repositories) {
62
        $this->repositories = $repositories->values();
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return \Illuminate\Support\Collection $repositories
69
     */
70
    public function getRepositories() {
71
        return new Collection($this->repositories);
72
    }
73
}
74