System::writeFile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace RoundingWell\Schematic;
4
5
/**
6
 * @codeCoverageIgnore
7
 */
8
class System
9
{
10
    public function writeFile($file, $contents)
11
    {
12
        $directory = pathinfo($file, PATHINFO_DIRNAME);
13
14
        if (!file_exists($directory)) {
15
            mkdir($directory, 0755, true);
16
        }
17
18
        return (int) file_put_contents($file, $contents);
19
    }
20
}
21