Passed
Push — etls ( 3c161b )
by Fabrice
11:34
created

DiskRead::setSourceDiskPath()   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 1
dl 0
loc 5
rs 10
1
<?php
2
3
/*
4
 * This file is part of YaEtl
5
 *     (c) Fabrice de Stefanis / https://github.com/fab2s/YaEtl
6
 * This source file is licensed under the MIT license which you will
7
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
8
 */
9
10
namespace fab2s\YaEtl\Laravel\Etl\Streams\Traits;
11
12
use Illuminate\Filesystem\FilesystemAdapter;
13
14
trait DiskRead
15
{
16
    /**
17
     * @var FilesystemAdapter|null
18
     */
19
    protected $sourceDisk = null;
20
21
    /**
22
     * @var string
23
     */
24
    protected $sourceDiskPath = '';
25
26
    public function getSourceDisk(): ?FilesystemAdapter
27
    {
28
        return $this->sourceDisk;
29
    }
30
31
    public function setSourceDisk(?FilesystemAdapter $sourceDisk): self
32
    {
33
        $this->sourceDisk = $sourceDisk;
34
35
        return $this;
36
    }
37
38
    public function setSourceDiskPath(string $sourceDiskPath): self
39
    {
40
        $this->sourceDiskPath = $this->slashPath($sourceDiskPath);
41
42
        return $this;
43
    }
44
45
    public function getSourceDiskPath(): string
46
    {
47
        return $this->sourceDiskPath;
48
    }
49
50
    abstract public function slashPath(string $path) : string;
51
}
52