Scope   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A Singleton() 0 3 1
A __construct() 0 3 1
A Prototype() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of slick/di package
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Di\Definition;
11
12
/**
13
 * Scope used in the definition
14
 *
15
 * @package Slick\Di\Definition
16
 * @author  Filipe Silva <[email protected]>
17
 *
18
 */
19
class Scope
20
{
21
    private $value;
22
23
    const SINGLETON = 'singleton';
24
    const PROTOTYPE = 'prototype';
25
26
    public function __construct($value)
27
    {
28
        $this->value = $value;
29
    }
30
31
    public static function Singleton()
32
    {
33
        return new Scope(Scope::SINGLETON);
34
    }
35
36
    public static function Prototype()
37
    {
38
        return new Scope(Scope::PROTOTYPE);
39
    }
40
41
    public function __toString()
42
    {
43
        return $this->value;
44
    }
45
}
46