Code Duplication    Length = 11-11 lines in 7 locations

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/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

Core/Executor/LanguageManager.php 1 location

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

Core/Executor/SectionManager.php 1 location

@@ 119-129 (lines=11) @@
116
     * @return SectionCollection
117
     * @throws \Exception
118
     */
119
    protected function matchSections($action, $step)
120
    {
121
        if (!isset($step->dsl['match'])) {
122
            throw new \Exception("A match condition is required to $action a section");
123
        }
124
125
        // convert the references passed in the match
126
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
127
128
        return $this->sectionMatcher->match($match);
129
    }
130
131
    /**
132
     * @param Section $section

Core/Executor/TrashManager.php 1 location

@@ 92-102 (lines=11) @@
89
     * @return TrashedItemCollection
90
     * @throws \Exception
91
     */
92
    protected function matchItems($action, $step)
93
    {
94
        if (!isset($step->dsl['match'])) {
95
            throw new \Exception("A match condition is required to $action trash items");
96
        }
97
98
        // convert the references passed in the match
99
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
100
101
        return $this->trashMatcher->match($match);
102
    }
103
104
    /**
105
     * @param \eZ\Publish\API\Repository\Values\Content\TrashItem|\eZ\Publish\API\Repository\Values\Content\Location $item

Core/Executor/ObjectStateGroupManager.php 1 location

@@ 142-152 (lines=11) @@
139
     * @return ObjectStateGroupCollection
140
     * @throws \Exception
141
     */
142
    protected function matchObjectStateGroups($action, $step)
143
    {
144
        if (!isset($step->dsl['match'])) {
145
            throw new \Exception("A match condition is required to $action an object state group");
146
        }
147
148
        // convert the references passed in the match
149
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
150
151
        return $this->objectStateGroupMatcher->match($match);
152
    }
153
154
    /**
155
     * @param ObjectStateGroup $objectStateGroup

Core/Executor/ObjectStateManager.php 1 location

@@ 160-170 (lines=11) @@
157
     * @return ObjectStateCollection
158
     * @throws \Exception
159
     */
160
    protected function matchObjectStates($action, $step)
161
    {
162
        if (!isset($step->dsl['match'])) {
163
            throw new \Exception("A match condition is required to $action an object state");
164
        }
165
166
        // convert the references passed in the match
167
        $match = $this->resolveReferencesRecursively($step->dsl['match']);
168
169
        return $this->objectStateMatcher->match($match);
170
    }
171
172
    /**
173
     * @param ObjectState $objectState