Completed
Push — master ( 9b439e...de8363 )
by Igor
03:05
created

Storage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFile() 0 4 1
A getFile() 0 8 2
1
<?php
2
3
/**
4
 * @link https://github.com/rkit/filemanager-yii2
5
 * @copyright Copyright (c) 2015 Igor Romanov
6
 * @license [MIT](http://opensource.org/licenses/MIT)
7
 */
8
9
namespace rkit\filemanager;
10
11
use yii\base\InvalidParamException;
12
use rkit\filemanager\StorageInterface;
13
14
/**
15
 * This is the base storage
16
 */
17
abstract class Storage implements StorageInterface
18
{
19
    protected $file;
20
21 35
    public function setFile(\rkit\filemanager\models\File $file)
22
    {
23 35
        $this->file = $file;
24 35
    }
25
26 36
    public function getFile()
27
    {
28 36
        if ($this->file === null) {
29 1
            throw new InvalidParamException('The file is not initialized');
30
        }
31
32 35
        return $this->file;
33
    }
34
}
35