Code Duplication    Length = 11-11 lines in 6 locations

Core/Executor/TagManager.php 1 location

@@ 153-163 (lines=11) @@
150
     * @return TagCollection
151
     * @throws \Exception
152
     */
153
    protected function matchTags($action, $step)
154
    {
155
        if (!isset($step->dsl['match'])) {
156
            throw new \Exception("A match condition is required to $action a Tag");
157
        }
158
159
        // convert the references passed in the match
160
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
161
162
        return $this->tagMatcher->match($match);
163
    }
164
165
    /**
166
     * @param $object

Core/Executor/TrashManager.php 1 location

@@ 96-106 (lines=11) @@
93
     * @return TrashedItemCollection
94
     * @throws \Exception
95
     */
96
    protected function matchItems($action, $step)
97
    {
98
        if (!isset($step->dsl['match'])) {
99
            throw new \Exception("A match condition is required to $action trash items");
100
        }
101
102
        // convert the references passed in the match
103
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
104
105
        return $this->trashMatcher->match($match);
106
    }
107
108
    /**
109
     * Sets references to certain trashed-item attributes.

Core/Executor/ContentTypeGroupManager.php 1 location

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

Core/Executor/ObjectStateGroupManager.php 1 location

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

Core/Executor/ObjectStateManager.php 1 location

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

Core/Executor/SectionManager.php 1 location

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