VirtualFile::isFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/******************************************************************************
3
 * An iterator interface over the Leagues flysystem.
4
 * Copyright (c) 2021, 2015 Richard Klees <[email protected]>
5
 *
6
 * This software is licensed under GPLv3. You should have received
7
 * a copy of the along with the code.
8
 */
9
10
namespace Lechimp\Flightcontrol;
11
12
/**
13
 * This represents a File-like object that is required during
14
 * unfolding a directory structure.
15
 */
16
class VirtualFile extends VirtualFSObject
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $content;
22
23 5
    public function __construct(Flightcontrol $flightcontrol, $path, $content)
24
    {
25 5
        parent::__construct($flightcontrol, $path);
26 5
        assert(is_string($content));
27 5
        $this->content = $content;
28 5
    }
29
30 5
    public function isFile() : bool
31
    {
32 5
        return true;
33
    }
34
35 4
    public function content() : string
36
    {
37 4
        return $this->content;
38
    }
39
}
40