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

SetBucket   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 24
ccs 0
cts 7
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A handle() 0 3 1
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