Code Duplication    Length = 5-5 lines in 2 locations

Core/Executor/SectionManager.php 1 location

@@ 34-38 (lines=5) @@
31
     */
32
    protected function create($step)
33
    {
34
        foreach (array('name', 'identifier') as $key) {
35
            if (!isset($step->dsl[$key])) {
36
                throw new \Exception("The '$key' key is missing in a section creation definition");
37
            }
38
        }
39
40
        $sectionService = $this->repository->getSectionService();
41

Core/Executor/ObjectStateManager.php 1 location

@@ 49-53 (lines=5) @@
46
     */
47
    protected function create($step)
48
    {
49
        foreach (array('object_state_group', 'names', 'identifier') as $key) {
50
            if (!isset($step->dsl[$key])) {
51
                throw new \Exception("The '$key' key is missing in a object state creation definition");
52
            }
53
        }
54
55
        if (!count($step->dsl['names'])) {
56
            throw new \Exception('No object state names have been defined. Need to specify at least one to create the state.');