Completed
Push — development ( 616ff4...ce498d )
by
unknown
15s queued 10s
created

BaseInput::setFilePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace WeDevBr\Mati\Inputs;
4
5
use WeDevBr\Mati\Support\Contracts\IdentityInputInterface;
6
7
/**
8
 * Wrapper for identity input
9
 *
10
 * @author Gabriel Mineiro <[email protected]>
11
 */
12
abstract class BaseInput implements IdentityInputInterface
13
{
14
    protected $file_path;
15
16
    public function setFilePath(string $path)
17
    {
18
        $this->file_path = $path;
19
        return $this;
20
    }
21
22
    public function getFileName(): string
23
    {
24
        return basename($this->file_path);
25
    }
26
27
    public function getFileContents()
28
    {
29
        return file_get_contents($this->file_path);
30
    }
31
32
    abstract public function toArray();
33
}
34