Core/Executor/MigrationDefinitionExecutor.php 1 location
|
@@ 32-47 (lines=16) @@
|
| 29 |
|
* @return mixed |
| 30 |
|
* @throws \Exception |
| 31 |
|
*/ |
| 32 |
|
public function execute(MigrationStep $step) |
| 33 |
|
{ |
| 34 |
|
parent::execute($step); |
| 35 |
|
|
| 36 |
|
if (!isset($step->dsl['mode'])) { |
| 37 |
|
throw new \Exception("Invalid step definition: missing 'mode'"); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
$action = $step->dsl['mode']; |
| 41 |
|
|
| 42 |
|
if (!in_array($action, $this->supportedActions)) { |
| 43 |
|
throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'"); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
return $this->$action($step->dsl, $step->context); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
/** |
| 50 |
|
* @todo allow to save to disk |
Core/Executor/MigrationExecutor.php 1 location
|
@@ 33-48 (lines=16) @@
|
| 30 |
|
* @return mixed |
| 31 |
|
* @throws \Exception |
| 32 |
|
*/ |
| 33 |
|
public function execute(MigrationStep $step) |
| 34 |
|
{ |
| 35 |
|
parent::execute($step); |
| 36 |
|
|
| 37 |
|
if (!isset($step->dsl['mode'])) { |
| 38 |
|
throw new \Exception("Invalid step definition: missing 'mode'"); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
$action = $step->dsl['mode']; |
| 42 |
|
|
| 43 |
|
if (!in_array($action, $this->supportedActions)) { |
| 44 |
|
throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'"); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
return $this->$action($step->dsl, $step->context); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
/** |
| 51 |
|
* @param array $dsl |
Core/Executor/ReferenceExecutor.php 1 location
|
@@ 33-48 (lines=16) @@
|
| 30 |
|
* @return mixed |
| 31 |
|
* @throws \Exception |
| 32 |
|
*/ |
| 33 |
|
public function execute(MigrationStep $step) |
| 34 |
|
{ |
| 35 |
|
parent::execute($step); |
| 36 |
|
|
| 37 |
|
if (!isset($step->dsl['mode'])) { |
| 38 |
|
throw new \Exception("Invalid step definition: missing 'mode'"); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
$action = $step->dsl['mode']; |
| 42 |
|
|
| 43 |
|
if (!in_array($action, $this->supportedActions)) { |
| 44 |
|
throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'"); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
return $this->$action($step->dsl, $step->context); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
protected function set($dsl, $context) |
| 51 |
|
{ |