Passed
Push — master ( 844081...2958af )
by JHONATAN
02:19
created

ClassMetadata::serialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 8
cp 0
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Vox\Metadata;
4
5
use Metadata\MergeableClassMetadata;
6
7
class ClassMetadata extends MergeableClassMetadata
8
{
9
    use AnnotationsTrait;
10
    
11
    public function serialize()
12
    {
13
        return serialize(array(
14
            $this->name,
15
            $this->methodMetadata,
16
            $this->propertyMetadata,
17
            $this->fileResources,
18
            $this->createdAt,
19
            $this->annotations,
20
        ));
21
    }
22
23 View Code Duplication
    public function unserialize($str)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
    {
25
        list(
26
            $this->name,
27
            $this->methodMetadata,
28
            $this->propertyMetadata,
29
            $this->fileResources,
30
            $this->createdAt,
31
            $this->annotations
32
        ) = unserialize($str);
33
34
        $this->reflection = new \ReflectionClass($this->name);
35
    }
36
}
37