Passed
Push — master ( 2b8f81...145d48 )
by Gaetano
10:22 queued 05:19
created

Migration::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 6
dl 0
loc 8
ccs 0
cts 8
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
    protected $name;
25
    protected $md5;
26
    protected $path;
27
    protected $executionDate;
28
    protected $status;
29
    protected $executionError;
30
31
    /**
32
     * @param string $name
33
     * @param string $md5 checksum of the migration definition file
34
     * @param string $path
35
     * @param int $executionDate timestamp
36
     * @param int $status
37
     * @param $executionError
38
     */
39
    public function __construct($name, $md5, $path, $executionDate = null, $status = 0, $executionError = null)
40
    {
41
        $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...
42
        $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...
43
        $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...
44
        $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...
45
        $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...
46
        $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...
47
    }
48
}
49