Test Failed
Push — master ( 8ae349...d51c96 )
by Stephen
01:07 queued 11s
created

UploadStreaming::disableStreaming()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Sfneal\Helpers\Aws\S3\Utils\Traits;
4
5
trait UploadStreaming
6
{
7
    /**
8
     * @var bool Enable/disable upload & download streaming
9
     */
10
    protected $streaming;
11
12
    /**
13
     * Enable upload/download streaming regardless of config setting.
14
     *
15
     * @return $this
16
     */
17
    public function enableStreaming(): self
18
    {
19
        $this->streaming = true;
20
21
        return $this;
22
    }
23
24
    /**
25
     * Disable upload/download streaming regardless of config setting.
26
     *
27
     * @return $this
28
     */
29
    public function disableStreaming(): self
30
    {
31
        $this->streaming = false;
32
33
        return $this;
34
    }
35
36
    /**
37
     * Determine if upload/download streaming is enabled.
38
     *
39
     * @return bool
40
     */
41
    protected function isStreamingEnabled(): bool
42
    {
43
        return $this->streaming ?? config('s3-helpers.streaming', true);
44
    }
45
}
46