MigrationStep   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 24
ccs 5
cts 10
cp 0.5
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __set_state() 0 6 1
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\API\Value;
4
5
/**
6
 * @property-read string $type
7
 * @property-read array $dsl
8
 * @property-read array $context
9
 */
10
class MigrationStep extends AbstractValue
11
{
12
    protected $type;
13
    protected $dsl;
14
    protected $context;
15
16 141
    public function __construct($type, array $dsl = array(), array $context = array())
17
    {
18 141
        $this->type = $type;
0 ignored issues
show
Bug introduced by
The property type is declared read-only in Kaliop\eZMigrationBundle\API\Value\MigrationStep.
Loading history...
19 141
        $this->dsl = $dsl;
0 ignored issues
show
Bug introduced by
The property dsl is declared read-only in Kaliop\eZMigrationBundle\API\Value\MigrationStep.
Loading history...
20 141
        $this->context = $context;
0 ignored issues
show
Bug introduced by
The property context is declared read-only in Kaliop\eZMigrationBundle\API\Value\MigrationStep.
Loading history...
21 141
    }
22
23
    /**
24
     * Allow the class to be serialized to php using var_export
25
     * @param array $data
26
     * @return static
27
     */
28
    public static function __set_state(array $data)
29
    {
30
        return new static(
31
            $data['type'],
32
            $data['dsl'],
33
            $data['context']
34
        );
35
    }
36
}
37