Completed
Push — master ( 579af5...b29473 )
by Oleg
07:53
created

File   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 45
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A exists() 0 4 1
A has() 0 4 1
A read() 0 4 1
A getSize() 0 4 1
A delete() 0 4 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/lugnsk/micro
10
 * @copyright Copyright &copy; 2013 Oleg Lunegov
11
 * @license /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
     * @inheritdoc
24
     */
25
    public function exists($filePath)
26
    {
27
        return $this->file_exists($filePath);
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function has($filePath)
34
    {
35
        return $this->file_exists($filePath);
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function read($filePath)
42
    {
43
        return $this->file_get_contents($filePath);
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function getSize($filePath)
50
    {
51
        return $this->size($filePath);
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    public function delete($filePath)
58
    {
59
        return $this->unlink($filePath);
60
    }
61
}
62