Code Duplication    Length = 11-11 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/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.