| Total Complexity | 2 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | abstract class AbstractDefinition implements DefinitionInterface |
||
| 22 | { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var Scope|string |
||
| 26 | */ |
||
| 27 | protected $scope; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Implements the ContainerAwareInterface |
||
| 31 | */ |
||
| 32 | use ContainerAwareMethods; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Set resolution scope |
||
| 36 | * |
||
| 37 | * @param string|Scope $scope |
||
| 38 | * |
||
| 39 | * @return self|$this|AbstractDefinition |
||
| 40 | */ |
||
| 41 | public function setScope($scope): DefinitionInterface|static |
||
|
|
|||
| 42 | { |
||
| 43 | $this->scope = $scope; |
||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get resolution scope |
||
| 49 | * |
||
| 50 | * @return Scope|string |
||
| 51 | */ |
||
| 52 | 84 | public function getScope(): string|Scope |
|
| 53 | { |
||
| 54 | 84 | if (!$this->scope) { |
|
| 55 | return Scope::Singleton(); |
||
| 60 |