SignatureTrait::gmt_iso8601()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 2
b 1
f 0
nc 1
nop 1
dl 0
loc 4
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\Traits;
13
14
trait SignatureTrait
15
{
16
    /**
17
     * gmt.
18
     *
19
     * @param $time
20
     *
21
     * @return string
22
     *
23
     * @throws \Exception
24
     */
25
    public function gmt_iso8601($time)
26
    {
27
        // fix bug https://connect.console.aliyun.com/connect/detail/162632
28
        return (new \DateTime(null, new \DateTimeZone('UTC')))->setTimestamp($time)->format('Y-m-d\TH:i:s\Z');
29
    }
30
}
31