ClassMetadata   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 46
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setIsMigratable() 0 4 1
A serialize() 0 11 1
A unserialize() 0 12 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Domain\EventSourcing\Metadata;
12
13
use Cubiche\Core\Metadata\ClassMetadata as BaseClassMetadata;
14
15
/**
16
 * ClassMetadata class.
17
 *
18
 * @author Ivannis Suárez Jerez <[email protected]>
19
 */
20
class ClassMetadata extends BaseClassMetadata
21
{
22
    /**
23
     * @var bool
24
     */
25
    public $isMigratable = false;
26
27
    /**
28
     * @param bool $isMigratable
29
     */
30
    public function setIsMigratable($isMigratable)
31
    {
32
        $this->isMigratable = (bool) $isMigratable;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function serialize()
39
    {
40
        return serialize(array(
41
            $this->name,
42
            $this->methodMetadata,
43
            $this->propertyMetadata,
44
            $this->fileResources,
45
            $this->createdAt,
46
            $this->isMigratable,
47
        ));
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function unserialize($str)
54
    {
55
        list(
56
            $this->name,
57
            $this->methodMetadata,
58
            $this->propertyMetadata,
59
            $this->fileResources,
60
            $this->createdAt,
61
            $this->isMigratable) = unserialize($str);
62
63
        $this->reflection = new \ReflectionClass($this->name);
64
    }
65
}
66