Code Duplication    Length = 15-15 lines in 3 locations

src/Subjects/AbstractCategorySubject.php 2 locations

@@ 265-279 (lines=15) @@
262
     * @return integer The mapped entity ID
263
     * @throws \Exception Is thrown, if the path can not be mapped
264
     */
265
    public function mapPathEntityId($path)
266
    {
267
268
        // query whether or not a entity ID for the passed path has been mapped
269
        if (isset($this->pathEntityIdMapping[$unifiedPath = $this->unifyPath($path)])) {
270
            return $this->pathEntityIdMapping[$unifiedPath];
271
        }
272
273
        // throw an exception if not
274
        throw new \Exception(
275
            $this->appendExceptionSuffix(
276
                sprintf('Can\'t map path %s to any entity ID', $path)
277
            )
278
        );
279
    }
280
281
    /**
282
     * Add the passed path => store view code mapping.
@@ 411-425 (lines=15) @@
408
     * @return integer The store website ID
409
     * @throws \Exception Is thrown, if the store website with the requested code is not available
410
     */
411
    public function getStoreWebsiteIdByCode($code)
412
    {
413
414
        // query whether or not, the requested store website is available
415
        if (isset($this->storeWebsites[$code])) {
416
            return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
417
        }
418
419
        // throw an exception, if not
420
        throw new \Exception(
421
            $this->appendExceptionSuffix(
422
                sprintf('Found invalid website code "%s"', $code)
423
            )
424
        );
425
    }
426
427
    /**
428
     * Return's the category with the passed path.

src/Subjects/BunchSubject.php 1 location

@@ 268-282 (lines=15) @@
265
     * @return array The requested entity type
266
     * @throws \Exception Is thrown, if the requested entity type is not available
267
     */
268
    public function getEntityType()
269
    {
270
271
        // query whether or not the entity type with the passed code is available
272
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
273
            return $this->entityTypes[$entityTypeCode];
274
        }
275
276
        // throw a new exception
277
        throw new \Exception(
278
            $this->appendExceptionSuffix(
279
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
280
            )
281
        );
282
    }
283
284
    /**
285
     * Return's TRUE, if the passed URL key varchar value IS related with the actual PK.