File::delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
nc 1
cc 1
eloc 2
nop 1
1
<?php /** MicroFile */
2
3
namespace Micro\File\Drivers;
4
5
/**
6
 * Class File is interface for filesystem drivers
7
 *
8
 * @author Oleg Lunegov <[email protected]>
9
 * @link https://github.com/linpax/microphp-framework
10
 * @copyright Copyright (c) 2013 Oleg Lunegov
11
 * @license https://github.com/linpax/microphp-framework/blob/master/LICENSE
12
 * @package Micro
13
 * @subpackage File\Drivers
14
 * @version 1.0
15
 * @since 1.0
16
 */
17
abstract class File implements IFile
18
{
19
    /** @var mixed $stream File stream */
20
    protected $stream;
21
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function exists($filePath)
27
    {
28
        return $this->file_exists($filePath);
29
    }
30
31
    /**
32
     * @inheritdoc
33
     */
34
    public function has($filePath)
35
    {
36
        return $this->file_exists($filePath);
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function read($filePath)
43
    {
44
        return $this->file_get_contents($filePath);
45
    }
46
47
    /**
48
     * @inheritdoc
49
     */
50
    public function getSize($filePath)
51
    {
52
        return $this->size($filePath);
53
    }
54
55
    /**
56
     * @inheritdoc
57
     */
58
    public function delete($filePath)
59
    {
60
        return $this->unlink($filePath);
61
    }
62
}
63