NotSupportedException::forLink()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace League\Flysystem;
4
5
use RuntimeException;
6
use SplFileInfo;
7
8
class NotSupportedException extends RuntimeException
9
{
10
    /**
11
     * Create a new exception for a link.
12
     *
13
     * @param SplFileInfo $file
14
     *
15
     * @return static
16
     */
17 3
    public static function forLink(SplFileInfo $file)
18
    {
19 3
        $message = 'Links are not supported, encountered link at ';
20
21 3
        return new static($message . $file->getPathname());
22
    }
23
24
    /**
25
     * Create a new exception for a link.
26
     *
27
     * @param string $systemType
28
     *
29
     * @return static
30
     */
31 3
    public static function forFtpSystemType($systemType)
32
    {
33 3
        $message = "The FTP system type '$systemType' is currently not supported.";
34
35 3
        return new static($message);
36
    }
37
}
38