Total Complexity | 7 |
Total Lines | 76 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class GetPresignedUrlCommand extends ExecutableCommand implements HasBucket |
||
16 | { |
||
17 | /** @var array */ |
||
18 | protected $args = []; |
||
19 | |||
20 | /** @var mixed */ |
||
21 | protected $expiration; |
||
22 | |||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | public function getBucket(): string |
||
27 | { |
||
28 | return $this->args['Bucket'] ?? ''; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | public function inBucket(string $name) |
||
37 | { |
||
38 | $this->args['Bucket'] = $name; |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getFilename(): string |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param string $filename |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function byFilename(string $filename) |
||
57 | { |
||
58 | $this->args['Key'] = $filename; |
||
59 | |||
60 | return $this; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return mixed |
||
65 | */ |
||
66 | public function getExpiration() |
||
67 | { |
||
68 | return $this->expiration; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @param int|string|\DateTime $expiration |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function withExpiration($expiration) |
||
77 | { |
||
78 | $this->expiration = $expiration; |
||
79 | |||
80 | return $this; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @internal used by the handlers |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | public function getArgs(): array |
||
91 | } |
||
92 | } |
||
93 |