ExternalFileItem::setState()   A
last analyzed

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 1
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Oliverde8\Component\PhpEtl\Item;
5
6
use Oliverde8\Component\PhpEtl\Model\File\FileSystemInterface;
7
8
class ExternalFileItem implements ItemInterface
9
{
10
    const STATE_NEW = "new";
11
    const STATE_PROCESSING = "processing";
12
13
    const STATE_PROCESSED = "processed";
14
15
    protected string $filePath;
16
17
    protected FileSystemInterface $fileSystem;
18
19
    protected string $state;
20
21
    public function __construct(string $filePath, FileSystemInterface $fileSystem)
22
    {
23
        $this->fileSystem = $fileSystem;
24
        $this->filePath = $filePath;
25
        $this->state = self::STATE_NEW;
26
    }
27
28
    public function getFileSystem(): FileSystemInterface
29
    {
30
        return $this->fileSystem;
31
    }
32
33
    public function getState(): string
34
    {
35
        return $this->state;
36
    }
37
38
    public function setState(string $state): void
39
    {
40
        $this->state = $state;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getFilePath(): string
47
    {
48
        return $this->filePath;
49
    }
50
}