Completed
Push — master ( 92472c...fe56a0 )
by Vitaly
02:18
created

Controller::toClassMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 27.07.2016
6
 * Time: 1:55.
7
 */
8
namespace samsonframework\container\annotation;
9
10
use samsonframework\container\Container;
11
use samsonframework\container\metadata\ClassMetadata;
12
13
/**
14
 * Controller annotation class.
15
 *
16
 * This annotation adds class to Controller container scope.
17
 * @see samsonframework\container\Container::SCOPE_CONTROLLER
18
 *
19
 * @Annotation
20
 */
21
class Controller implements ClassInterface
22
{
23
    /** {@inheritdoc} */
24 1
    public function toClassMetadata(ClassMetadata $metadata)
25
    {
26
        // Add controller scope to metadata collection
27 1
        $metadata->scopes[] = Container::SCOPE_CONTROLLER;
28 1
    }
29
}
30