Filesystem::put()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace T4web\Filesystem;
4
5
use Symfony\Component\Filesystem\Filesystem as BaseFilesystem;
6
7
class Filesystem extends BaseFilesystem
8
{
9
    /**
10
     * @param string $filename
11
     * @return bool
12
     */
13
    public function isWritable($filename)
14
    {
15
        return is_writable($filename);
16
    }
17
18
    /**
19
     * @param string $filename
20
     * @return bool
21
     */
22
    public function isDir($filename)
23
    {
24
        return is_dir($filename);
25
    }
26
27
    /**
28
     * @param string $filename
29
     * @param string $data
30
     * @param int $flags
31
     * @return int
32
     */
33
    public function put($filename, $data, $flags = FILE_APPEND)
34
    {
35
        return file_put_contents($filename, $data, $flags);
36
    }
37
}
38