BaseInput   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setFilePath() 0 5 1
A getFileName() 0 4 1
A getFileContents() 0 4 1
toArray() 0 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