Passed
Push — master ( 53ff19...ea1022 )
by Luo
54s queued 11s
created

SetBucket::getMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
/*
4
 * This file is part of the iidestiny/flysystem-oss.
5
 *
6
 * (c) iidestiny <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Iidestiny\Flysystem\Oss\Plugins;
13
14
use League\Flysystem\Plugin\AbstractPlugin;
15
16
class SetBucket extends AbstractPlugin
17
{
18
    /**
19
     * sign url.
20
     *
21
     * @return string
22
     */
23
    public function getMethod()
24
    {
25
        return 'bucket';
26
    }
27
28
    /**
29
     * handle.
30
     *
31
     * @param       $path
32
     * @param       $timeout
33
     * @param array $options
34
     *
35
     * @return mixed
36
     */
37
    public function handle($bucket)
38
    {
39
        return $this->filesystem->getAdapter()->bucket($bucket);
40
    }
41
}
42