Bean::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace evelikto\di;
4
5
/** Dependency DTO, which wraps all informations needed to store it. */
6
class Bean
7
{
8
    const SCOPE_PROTOTYPE = 'SCOPE_PROTOTYPE';
9
    const SCOPE_SESSION = 'SCOPE_SESSION';
10
    const SCOPE_GLOBAL = 'SCOPE_GLOBAL';
11
12
    public $name, $aliases = [], $value, $scope;
13
14
    public function __construct(string $name, $value, string $scope = null) {
15
        $this->name = $name;
16
        $this->value = $value;
17
        $this->scope = $scope;
18
    }
19
20
    public function addAlias(string $alias) {
21
        $this->aliases[] = $alias;
22
    }
23
}