InMemoryFileSystem::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/18/15
5
 * Time: 11:00 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\SchemaOrg\Generator\FileSystem;
12
13
/**
14
 * Class InMemoryFileSystem.
15
 */
16
class InMemoryFileSystem implements FileSystemInterface
17
{
18
    private $fileSystem = [];
19
20
    /**
21
     * @param string $filePath
22
     * @param string $contents
23
     */
24
    public function write($filePath, $contents)
25
    {
26
        $this->fileSystem[$filePath] = $contents;
27
    }
28
29
    /**
30
     * @param string $filePath
31
     *
32
     * @return string
33
     */
34
    public function get($filePath)
35
    {
36
        return $this->fileSystem[$filePath];
37
    }
38
}
39