Code Duplication    Length = 5-5 lines in 3 locations

Core/Executor/ObjectStateGroupManager.php 1 location

@@ 38-42 (lines=5) @@
35
     */
36
    protected function create($step)
37
    {
38
        foreach (array('names', 'identifier') as $key) {
39
            if (!isset($step->dsl[$key])) {
40
                throw new \Exception("The '$key' key is missing in a object state group creation definition");
41
            }
42
        }
43
44
        $objectStateService = $this->repository->getObjectStateService();
45

Core/Executor/ObjectStateManager.php 1 location

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

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