Passed
Push — master ( 8807b4...37e483 )
by Wilmer
03:08
created

TestTrait::getCache()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Support;
6
7
use Yiisoft\Db\Driver\PDO\ConnectionPDOInterface;
8
use Yiisoft\Db\Tests\Support\Stub\PDODriver;
9
10
trait TestTrait
11
{
12
    private CacheInterface|null $cache = null;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Tests\Support\CacheInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
    private QueryCache|null $queryCache = null;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Tests\Support\QueryCache was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
    private SchemaCache|null $schemaCache = null;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Tests\Support\SchemaCache was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
    protected function getConnection(string $fixture = '', string $dsn = 'sqlite::memory:'): ConnectionPDOInterface
17
    {
18
        $db = new Stub\Connection(new PDODriver($dsn), DbHelper::getQueryCache(), DbHelper::getSchemaCache());
19
20
        if ($fixture !== '') {
21
            DbHelper::loadFixture($db, __DIR__ . "/Fixture/$fixture.sql");
22
        }
23
24
        return $db;
25
    }
26
}
27