ExistCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilename() 0 3 1
A getBucket() 0 3 1
A byFilename() 0 5 1
A inBucket() 0 5 1
1
<?php
2
3
namespace diecoding\aws\s3\commands;
4
5
use diecoding\aws\s3\base\commands\ExecutableCommand;
6
use diecoding\aws\s3\base\commands\traits\Options;
7
use diecoding\aws\s3\interfaces\commands\HasBucket;
8
9
/**
10
 * Class ExistCommand
11
 *
12
 * @method bool execute()
13
 *
14
 * @package diecoding\aws\s3\commands
15
 */
16
class ExistCommand extends ExecutableCommand implements HasBucket
17
{
18
    use Options;
19
20
    /** @var string */
21
    protected $bucket;
22
23
    /** @var string */
24
    protected $filename;
25
26
    /**
27
     * @return string
28
     */
29
    public function getBucket(): string
30
    {
31
        return (string)$this->bucket;
32
    }
33
34
    /**
35
     * @param string $name
36
     *
37
     * @return $this
38
     */
39
    public function inBucket(string $name)
40
    {
41
        $this->bucket = $name;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getFilename(): string
50
    {
51
        return (string)$this->filename;
52
    }
53
54
    /**
55
     * @param string $filename
56
     *
57
     * @return $this
58
     */
59
    public function byFilename(string $filename)
60
    {
61
        $this->filename = $filename;
62
63
        return $this;
64
    }
65
}
66