InMemoryFileSystem   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
c 4
b 0
f 0
lcom 1
cbo 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 4 1
A get() 0 4 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