Migration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 39
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\API\Value;
4
5
/**
6
 * @property-read string $name
7
 * @property-read string $md5 of the original definition file
8
 * @property-read string $path
9
 * @property-read int $executionDate timestamp
10
 * @property-read integer $status
11
 * @property-read string $executionError
12
 */
13
class Migration extends AbstractValue
14
{
15
    const STATUS_TODO = 0;
16
    const STATUS_STARTED = 1;
17
    const STATUS_DONE = 2;
18
    const STATUS_FAILED = 3;
19
    const STATUS_SKIPPED = 4;
20
    const STATUS_SUSPENDED = 6;
21
    // the ones below are not yet supported
22
    const STATUS_PARTIALLY_DONE = 5;
23
24
    /** @var string */
25
    protected $name;
26
    /** @var string */
27
    protected $md5;
28
    /** @var string full path including the filename, relative to the app's root dir if contained within it */
29
    protected $path;
30
    /** @var int|null timestamp */
31
    protected $executionDate;
32
    /** @var int */
33
    protected $status;
34
    protected $executionError;
35
36
    /**
37
     * @param string $name
38
     * @param string $md5 checksum of the migration definition file
39
     * @param string $path
40
     * @param int $executionDate timestamp
41
     * @param int $status
42
     * @param $executionError
43
     */
44 108
    public function __construct($name, $md5, $path, $executionDate = null, $status = 0, $executionError = null)
45
    {
46 108
        $this->name = $name;
0 ignored issues
show
Bug introduced by
The property name is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
47 108
        $this->md5 = $md5;
0 ignored issues
show
Bug introduced by
The property md5 is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
48 108
        $this->path = $path;
0 ignored issues
show
Bug introduced by
The property path is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
49 108
        $this->executionDate = $executionDate;
0 ignored issues
show
Bug introduced by
The property executionDate is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
50 108
        $this->status = $status;
0 ignored issues
show
Bug introduced by
The property status is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
51 108
        $this->executionError = $executionError;
0 ignored issues
show
Bug introduced by
The property executionError is declared read-only in Kaliop\eZMigrationBundle\API\Value\Migration.
Loading history...
52 108
    }
53
}
54