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

Bucket   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Test Coverage

Coverage 68.42%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 19
c 1
b 0
f 0
dl 0
loc 57
ccs 13
cts 19
cp 0.6842
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getId() 0 3 1
A getType() 0 3 1
A getOptions() 0 3 1
A isS3Compatible() 0 3 1
A __construct() 0 7 1
A getCorsRules() 0 3 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