CycleDependencyProxy   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 45
ccs 16
cts 16
cp 1
rs 10
c 1
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getSchemaProvider() 0 3 1
A getSchema() 0 3 1
A __construct() 0 3 1
A getORM() 0 3 1
A getSchemaConveyor() 0 3 1
A getMigrationConfig() 0 3 1
A getMigrator() 0 3 1
A getDatabaseProvider() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Cycle\Command;
6
7
use Cycle\Database\DatabaseProviderInterface;
8
use Cycle\Migrations\Config\MigrationConfig;
9
use Cycle\Migrations\Migrator;
10
use Cycle\ORM\ORMInterface;
11
use Cycle\ORM\SchemaInterface;
12
use Cycle\Schema\Provider\SchemaProviderInterface;
13
use Psr\Container\ContainerInterface;
14
use Yiisoft\Yii\Cycle\Schema\SchemaConveyorInterface;
15
16
final class CycleDependencyProxy
17
{
18
    private ContainerInterface $container;
19
20 31
    public function __construct(ContainerInterface $container)
21
    {
22 31
        $this->container = $container;
23
    }
24
25 7
    public function getDatabaseProvider(): DatabaseProviderInterface
26
    {
27 7
        return $this->container->get(DatabaseProviderInterface::class);
28
    }
29
30 16
    public function getMigrationConfig(): MigrationConfig
31
    {
32 16
        return $this->container->get(MigrationConfig::class);
33
    }
34
35 17
    public function getMigrator(): Migrator
36
    {
37 17
        return $this->container->get(Migrator::class);
38
    }
39
40
    /**
41
     * Can be used in other packages
42
     */
43 1
    public function getORM(): ORMInterface
44
    {
45 1
        return $this->container->get(ORMInterface::class);
46
    }
47
48 7
    public function getSchema(): SchemaInterface
49
    {
50 7
        return $this->container->get(SchemaInterface::class);
51
    }
52
53 3
    public function getSchemaProvider(): SchemaProviderInterface
54
    {
55 3
        return $this->container->get(SchemaProviderInterface::class);
56
    }
57
58 5
    public function getSchemaConveyor(): SchemaConveyorInterface
59
    {
60 5
        return $this->container->get(SchemaConveyorInterface::class);
61
    }
62
}
63