Completed
Push — master ( cf2b70...0b1628 )
by Gaetano
06:47
created

MigrationAbortedException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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
    public function __construct($message = "", $status = Migration::STATUS_DONE, \Exception $previous = null)
13
    {
14
        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
        parent::__construct($message, $status, $previous);
19
    }
20
}
21