ExternalFileItem   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 41
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getState() 0 3 1
A getFileSystem() 0 3 1
A __construct() 0 5 1
A setState() 0 3 1
A getFilePath() 0 3 1
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
}