Passed
Push — master ( 4d0668...60ad61 )
by Petr
07:54
created

php-tests/StorageTests/AStorageTest.php (1 issue)

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