Test Failed
Pull Request — master (#870)
by Aleksei
08:56
created

StateStorage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getState() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Internal\Config;
6
7
use Spiral\Core\Internal\State;
8
9
class StateStorage
10
{
11
    /** @var array<string, State> */
12
    private array $states = [];
13
14
    /**
15
     * Get bindings for the given scope.
16
     */
17
    public function getState(string $scope): State
18
    {
19
        return $this->states[$scope] ??= new State();
20
    }
21
}
22