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

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/FileExecutor.php 1 location

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