Code Duplication    Length = 16-18 lines in 8 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

@@ 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

Core/Executor/FileExecutor.php 1 location

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

Core/Executor/HTTPExecutor.php 1 location

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

Core/Executor/MailExecutor.php 1 location

@@ 33-50 (lines=18) @@
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
        $this->skipStepIfNeeded($step);
48
49
        return $this->$action($step->dsl, $step->context);
50
    }
51
52
    /**
53
     * @param array $dsl

Core/Executor/ProcessExecutor.php 1 location

@@ 32-49 (lines=18) @@
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
        $this->skipStepIfNeeded($step);
47
48
        return $this->$action($step->dsl, $step->context);
49
    }
50
51
    /**
52
     * @param $dsl

Core/Executor/ReferenceExecutor.php 1 location

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

Core/Executor/ServiceExecutor.php 1 location

@@ 32-49 (lines=18) @@
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
        $this->skipStepIfNeeded($step);
47
48
        return $this->$action($step->dsl, $step->context);
49
    }
50
51
    /**
52
     * @param $dsl