Completed
Branch master (e35419)
by Gaetano
06:40
created

MigrationAbortedException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 4
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\API\Exception;
4
5
use Kaliop\eZMigrationBundle\API\Value\Migration;
6
7
/**
8
 * Throw this exception in any step to abort the migration and mark it as finished in either DONE or SKIPPED status
9
 */
10
class MigrationAbortedException extends \Exception
11
{
12 3
    public function __construct($message = "", $status = Migration::STATUS_DONE, \Exception $previous = null)
13
    {
14 3
        if ($status !== Migration::STATUS_DONE && $status !== Migration::STATUS_SKIPPED && $status !== Migration::STATUS_FAILED) {
15
            throw new \Exception("Unsupported migration status $status in MigrationAbortedException");
16
        }
17
18 3
        parent::__construct($message, $status, $previous);
19 3
    }
20
}
21