Passed
Pull Request — master (#52)
by
unknown
08:37
created

SignatureTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
c 2
b 1
f 0
dl 0
loc 20
ccs 0
cts 8
cp 0
rs 10
wmc 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\Traits;
13
14
use DateTime;
15
16
trait SignatureTrait
17
{
18
    /**
19
     * gmt.
20
     *
21
     * @param $time
22
     *
23
     * @return string
24
     *
25
     * @throws \Exception
26
     */
27
    public function gmt_iso8601($time)
28
    {
29
        // fix bug https://connect.console.aliyun.com/connect/detail/162632
30
        return (new \DateTime(null,new \DateTimeZone('UTC')))->setTimestamp($time)->format('Y-m-d\TH:i:s\Z')
31
    }
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected '}', expecting ';' on line 31 at column 4
Loading history...
32
}
33