Code Duplication    Length = 3-3 lines in 2 locations

Core/Executor/RepositoryExecutor.php 2 locations

@@ 221-223 (lines=3) @@
218
            $needSingleRef = (count($referencesDefinition) > 0);
219
220
            if ($needSingleRef) {
221
                if (count($entity) > 1) {
222
                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for multiple ' . $this->getCollectionName($entity) . 's');
223
                }
224
                if (count($entity) == 0) {
225
                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity). 's');
226
                }
@@ 224-226 (lines=3) @@
221
                if (count($entity) > 1) {
222
                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for multiple ' . $this->getCollectionName($entity) . 's');
223
                }
224
                if (count($entity) == 0) {
225
                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity). 's');
226
                }
227
            }
228
229
            $entity = reset($entity);