ClassMetadata   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 28
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 9 1
A unserialize() 0 12 1
1
<?php
2
3
namespace Vox\Metadata;
4
5
use Metadata\MergeableClassMetadata;
6
7
/**
8
 * Holds all metadata for a single class
9
 * 
10
 * @author Jhonatan Teixeira <[email protected]>
11
 */
12
class ClassMetadata extends MergeableClassMetadata
13
{
14
    use AnnotationsTrait;
15
    
16 1
    public function serialize()
17
    {
18 1
        return serialize(array(
19 1
            $this->name,
20 1
            $this->methodMetadata,
21 1
            $this->propertyMetadata,
22 1
            $this->fileResources,
23 1
            $this->createdAt,
24 1
            $this->annotations,
25
        ));
26
    }
27
28 1
    public function unserialize($str)
29
    {
30
        list(
31 1
            $this->name,
32 1
            $this->methodMetadata,
33 1
            $this->propertyMetadata,
34 1
            $this->fileResources,
35 1
            $this->createdAt,
36 1
            $this->annotations
37 1
        ) = unserialize($str);
38
39 1
        $this->reflection = new \ReflectionClass($this->name);
40 1
    }
41
}
42