Code Duplication    Length = 16-16 lines in 6 locations

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/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
    {

Core/Executor/MailExecutor.php 1 location

@@ 31-46 (lines=16) @@
28
     * @return mixed
29
     * @throws \Exception
30
     */
31
    public function execute(MigrationStep $step)
32
    {
33
        parent::execute($step);
34
35
        if (!isset($step->dsl['mode'])) {
36
            throw new \Exception("Invalid step definition: missing 'mode'");
37
        }
38
39
        $action = $step->dsl['mode'];
40
41
        if (!in_array($action, $this->supportedActions)) {
42
            throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'");
43
        }
44
45
        return $this->$action($step->dsl, $step->context);
46
    }
47
48
    /**
49
     * @param array $dsl

Core/Executor/HTTPExecutor.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
     * @param array $dsl

Core/Executor/ProcessExecutor.php 1 location

@@ 30-45 (lines=16) @@
27
     * @return mixed
28
     * @throws \Exception
29
     */
30
    public function execute(MigrationStep $step)
31
    {
32
        parent::execute($step);
33
34
        if (!isset($step->dsl['mode'])) {
35
            throw new \Exception("Invalid step definition: missing 'mode'");
36
        }
37
38
        $action = $step->dsl['mode'];
39
40
        if (!in_array($action, $this->supportedActions)) {
41
            throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'");
42
        }
43
44
        return $this->$action($step->dsl, $step->context);
45
    }
46
47
    /**
48
     * @param $dsl

Core/Executor/MigrationExecutor.php 1 location

@@ 36-51 (lines=16) @@
33
     * @return mixed
34
     * @throws \Exception
35
     */
36
    public function execute(MigrationStep $step)
37
    {
38
        parent::execute($step);
39
40
        if (!isset($step->dsl['mode'])) {
41
            throw new \Exception("Invalid step definition: missing 'mode'");
42
        }
43
44
        $action = $step->dsl['mode'];
45
46
        if (!in_array($action, $this->supportedActions)) {
47
            throw new \Exception("Invalid step definition: value '$action' is not allowed for 'mode'");
48
        }
49
50
        return $this->$action($step->dsl, $step->context);
51
    }
52
53
    /**
54
     * @param array $dsl