Code Duplication    Length = 16-18 lines in 8 locations

Core/Executor/FileExecutor.php 1 location

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

Core/Executor/HTTPExecutor.php 1 location

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

Core/Executor/MailExecutor.php 1 location

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

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/ProcessExecutor.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
    /**
55
     * @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