Passed
Push — master ( c520ec...7f55a3 )
by Gabriel
04:29
created

File::getName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
rs 10
ccs 0
cts 4
cp 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
namespace Nip\Filesystem;
3
4
use League\Flysystem\FilesystemInterface;
5
6
/**
7
 * Class File
8
 * @package Nip\Filesystem
9
 */
10
class File
11
{
12
    use File\HasFilesystem;
13
    use File\HasInformation;
14
    use File\HasOperations;
15
    use File\HasPath;
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public function __construct(FilesystemInterface $filesystem = null, $path = null)
21
    {
22
        $this->parseNameFromPath($path);
23
        $this->path = $path;
24
        $this->setFilesystem($filesystem);
0 ignored issues
show
Bug introduced by
It seems like $filesystem can also be of type null; however, parameter $filesystem of Nip\Filesystem\File::setFilesystem() does only seem to accept League\Flysystem\FilesystemInterface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        $this->setFilesystem(/** @scrutinizer ignore-type */ $filesystem);
Loading history...
25
    }
26
}
27