MockServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefinitions() 0 3 1
A getExtensions() 0 3 1
A setDefinition() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Testing;
6
7
use Yiisoft\Di\ServiceProviderInterface;
8
9
final class MockServiceProvider implements ServiceProviderInterface
10
{
11
    private array $definitions = [];
12
    private array $extensions = [];
13
14
    public function getDefinitions(): array
15
    {
16
        return $this->definitions;
17
    }
18
19
    public function getExtensions(): array
20
    {
21
        return $this->extensions;
22
    }
23
24
    public function setDefinition(string $id, mixed $definition): void
25
    {
26
        $this->definitions[$id] = $definition;
27
    }
28
}
29