ClassMetadata::serialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 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