Passed
Push — master ( 380356...2e1f1e )
by Petr
10:45
created

AStorageTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getStorage() 0 5 1
1
<?php
2
3
namespace StorageTests;
4
5
6
use kalanis\kw_storage\Interfaces\IStorage;
7
use kalanis\kw_storage\Storage as XStorage;
8
9
10
abstract class AStorageTest extends \CommonTestClass
11
{
12
    /**
13
     * @param IStorage|string $mockStorage
14
     * @return XStorage\Storage
15
     */
16
    protected function getStorage($mockStorage): XStorage\Storage
17
    {
18
        XStorage\Key\DirKey::setDir(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR);
19
        $storage = new XStorage\Factory(new XStorage\Key\Factory(), new XStorage\Target\Factory());
20
        return $storage->getStorage($mockStorage);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $storage->getStorage($mockStorage) could return the type null which is incompatible with the type-hinted return kalanis\kw_storage\Storage\Storage. Consider adding an additional type-check to rule them out.
Loading history...
21
    }
22
}
23