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

DiskWrite::getDestinationDisk()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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 DiskWrite
15
{
16
    /**
17
     * @var FilesystemAdapter|null
18
     */
19
    protected $destinationDisk = null;
20
21
    /**
22
     * @var string
23
     */
24
    protected $destinationDiskPath = '';
25
26
    public function getDestinationDisk(): ?FilesystemAdapter
27
    {
28
        return $this->destinationDisk;
29
    }
30
31
    public function setDestinationDisk(?FilesystemAdapter $destinationDisk): self
32
    {
33
        $this->destinationDisk = $destinationDisk;
34
35
        return $this;
36
    }
37
38
    public function getDestinationDiskPath(): string
39
    {
40
        return $this->destinationDiskPath;
41
    }
42
43
    public function setDestinationDiskPath(string $destinationDiskPath): self
44
    {
45
        $this->destinationDiskPath = $this->slashPath($destinationDiskPath);
46
47
        return $this;
48
    }
49
    abstract public function slashPath(string $path) : string;
50
}
51