Code Duplication    Length = 11-11 lines in 6 locations

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
     * @param ObjectStateGroup $objectStateGroup

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
     * @param \eZ\Publish\API\Repository\Values\Content\TrashItem|\eZ\Publish\API\Repository\Values\Content\Location $item

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 $object

Core/Executor/ObjectStateManager.php 1 location

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

Core/Executor/SectionManager.php 1 location

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

Core/Executor/TagManager.php 1 location

@@ 166-176 (lines=11) @@
163
     * @return TagCollection
164
     * @throws \Exception
165
     */
166
    protected function matchTags($action, $step)
167
    {
168
        if (!isset($step->dsl['match'])) {
169
            throw new \Exception("A match condition is required to $action a Tag");
170
        }
171
172
        // convert the references passed in the match
173
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
174
175
        return $this->tagMatcher->match($match);
176
    }
177
178
    /**
179
     * @param Tag $tag