Total Complexity | 3 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php |
||
15 | class MigrationDefinition extends AbstractValue |
||
16 | { |
||
17 | const STATUS_TO_PARSE = 0; |
||
18 | const STATUS_PARSED = 1; |
||
19 | const STATUS_INVALID = 2; |
||
20 | |||
21 | /** @var string filename */ |
||
22 | protected $name; |
||
23 | /** @var string full path including the filename, relative to the app's root dir if contained within it */ |
||
24 | protected $path; |
||
25 | protected $rawDefinition; |
||
26 | /** @var int */ |
||
27 | protected $status = 0; |
||
28 | /** @var MigrationStepsCollection */ |
||
29 | protected $steps; |
||
30 | protected $parsingError; |
||
31 | |||
32 | /** |
||
33 | * @param string $name |
||
34 | * @param string $path |
||
35 | * @param string $rawDefinition |
||
36 | * @param int $status |
||
37 | * @param MigrationStep[]|MigrationStepsCollection $steps |
||
38 | * @param string $parsingError |
||
39 | */ |
||
40 | 149 | public function __construct($name, $path, $rawDefinition, $status = 0, $steps = array(), $parsingError = null) |
|
41 | { |
||
42 | 149 | $this->name = $name; |
|
|
|||
43 | 149 | $this->path = $path; |
|
44 | 149 | $this->rawDefinition = $rawDefinition; |
|
45 | 149 | $this->status = $status; |
|
46 | 149 | $this->steps = ($steps instanceof MigrationStepsCollection) ? $steps : new MigrationStepsCollection($steps); |
|
47 | 149 | $this->parsingError = $parsingError; |
|
48 | 149 | } |
|
49 | |||
50 | /** |
||
51 | * Allow the class to be serialized to php using var_export |
||
52 | * @param array $data |
||
53 | * @return static |
||
54 | */ |
||
55 | public static function __set_state(array $data) |
||
64 | ); |
||
65 | } |
||
67 |