Passed
Pull Request — master (#66)
by
unknown
123:20 queued 120:32
created

Bucket::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BackblazeB2;
4
5
class Bucket
6
{
7
    const TYPE_PUBLIC = 'allPublic';
8
    const TYPE_PRIVATE = 'allPrivate';
9
10
    protected $id;
11
    protected $name;
12
    protected $type;
13
    protected $options;
14
    protected $corsRules;
15
16
    /**
17
     * Bucket constructor.
18
     *
19
     * @param $id
20
     * @param $name
21
     * @param $type
22
     * @param $options
23
     * @param $corsRules
24
     */
25 6
    public function __construct($id, $name, $type, $options, $corsRules)
26
    {
27 6
        $this->id = $id;
28 6
        $this->name = $name;
29 6
        $this->type = $type;
30 6
        $this->options = $options;
31 6
        $this->corsRules = $corsRules;
32 6
    }
33
34 2
    public function getId()
35
    {
36 2
        return $this->id;
37
    }
38
39 2
    public function getName()
40
    {
41 2
        return $this->name;
42
    }
43
44 4
    public function getType()
45
    {
46 4
        return $this->type;
47
    }
48
49
    public function getOptions()
50
    {
51
        return $this->options;
52
    }
53
54
    public function getCorsRules()
55
    {
56
        return $this->corsRules;
57
    }
58
59
    public function isS3Compatible()
60
    {
61
        return in_array('s3', $this->getOptions());
62
    }
63
}
64