Completed
Push — master ( ec5252...14dc0c )
by Vitaly
02:23
created

Alias::toClassMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 2
cts 3
cp 0.6667
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
crap 1.037
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 02.08.16
6
 * Time: 1:59.
7
 */
8
namespace samsonframework\container\annotation;
9
10
use samsonframework\container\metadata\ClassMetadata;
11
12
/**
13
 * Class Alias.
14
 *
15
 * @Annotation
16
 */
17
class Alias extends AnnotationWithValue implements ClassInterface
18
{
19
    /** {@inheritdoc} */
20 1
    public function toClassMetadata(ClassMetadata $classMetadata)
21
    {
22
        // Add all found annotation collection to metadata collection
23 1
        $classMetadata->alias = array_merge($classMetadata->alias, $this->collection);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($classMetada...ias, $this->collection) of type array<integer,string> is incompatible with the declared type string of property $alias.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
    }
25
}
26