FileSystem   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A write() 0 10 2
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 FileSystem.
15
 */
16
class FileSystem implements FileSystemInterface
17
{
18
    /**
19
     * @param $filePath
20
     * @param $contents
21
     */
22
    public function write($filePath, $contents)
23
    {
24
        $path = pathinfo($filePath, PATHINFO_DIRNAME);
25
26
        if (!file_exists($path)) {
27
            mkdir($path, 0755, true);
28
        }
29
30
        file_put_contents($filePath, $contents);
31
    }
32
}
33