Local   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3
ccs 0
cts 6
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromRequestFile() 0 4 1
A fromPath() 0 8 2
1
<?php namespace BestServedCold\PhalueObjects\File;
2
3
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
4
use BestServedCold\PhalueObjects\File;
5
use BestServedCold\PhalueObjects\Request\File as RequestFile;
6
7
/**
8
 * Class Local
9
 *
10
 * @package BestServedCold\PhalueObjects\File
11
 */
12
class Local extends File
13
{
14
    /**
15
     * @param  RequestFile $url
16
     * @return static
17
     */
18
    public static function fromRequestFile(RequestFile $url)
19
    {
20
        return new static($url->getContents());
21
    }
22
23
    /**
24
     * @param  string $path
25
     * @return static
26
     */
27
    public static function fromPath($path)
28
    {
29
        if (! is_string($path)) {
30
            throw new InvalidTypeException($path, [ 'path' ]);
31
        }
32
33
        return static::fromRequestFile(RequestFile::fromPath($path));
34
    }
35
}
36