Code Duplication    Length = 11-13 lines in 5 locations

Core/Executor/ContentTypeGroupManager.php 1 location

@@ 105-115 (lines=11) @@
102
     * @return ContentTypeGroupCollection
103
     * @throws \Exception
104
     */
105
    protected function matchContentTypeGroups($action, $step)
106
    {
107
        if (!isset($step->dsl['match'])) {
108
            throw new \Exception("A match condition is required to $action an object state group");
109
        }
110
111
        // convert the references passed in the match
112
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
113
114
        return $this->contentTypeGroupMatcher->match($match);
115
    }
116
117
    /**
118
     * @param ContentTypeGroup|ContentTypeGroupCollection $object

Core/Executor/ObjectStateGroupManager.php 1 location

@@ 132-142 (lines=11) @@
129
     * @return ObjectStateGroupCollection
130
     * @throws \Exception
131
     */
132
    protected function matchObjectStateGroups($action, $step)
133
    {
134
        if (!isset($step->dsl['match'])) {
135
            throw new \Exception("A match condition is required to $action an object state group");
136
        }
137
138
        // convert the references passed in the match
139
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
140
141
        return $this->objectStateGroupMatcher->match($match);
142
    }
143
144
    /**
145
     * {@inheritdoc}

Core/Executor/ObjectStateManager.php 1 location

@@ 148-158 (lines=11) @@
145
     * @return ObjectStateCollection
146
     * @throws \Exception
147
     */
148
    protected function matchObjectStates($action, $step)
149
    {
150
        if (!isset($step->dsl['match'])) {
151
            throw new \Exception("A match condition is required to $action an object state");
152
        }
153
154
        // convert the references passed in the match
155
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
156
157
        return $this->objectStateMatcher->match($match);
158
    }
159
160
    /**
161
     * {@inheritdoc}

Core/Executor/SectionManager.php 1 location

@@ 101-113 (lines=13) @@
98
     * @return SectionCollection
99
     * @throws \Exception
100
     */
101
    protected function matchSections($action, $step)
102
    {
103
        if (!isset($step->dsl['match'])) {
104
            throw new \Exception("A match condition is required to $action a section");
105
        }
106
107
        $match = $step->dsl['match'];
108
109
        // convert the references passed in the match
110
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
111
112
        return $this->sectionMatcher->match($match);
113
    }
114
115
    /**
116
     * Sets references to certain section attributes.

Core/Executor/TagManager.php 1 location

@@ 102-112 (lines=11) @@
99
     * @return TagCollection
100
     * @throws \Exception
101
     */
102
    protected function matchTags($action, $step)
103
    {
104
        if (!isset($step->dsl['match'])) {
105
            throw new \Exception("A match condition is required to $action a Tag");
106
        }
107
108
        // convert the references passed in the match
109
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
110
111
        return $this->tagMatcher->match($match);
112
    }
113
114
    /**
115
     * @param $object