Code Duplication    Length = 15-15 lines in 3 locations

src/Subjects/AbstractCategorySubject.php 2 locations

@@ 262-276 (lines=15) @@
259
     * @return integer The mapped entity ID
260
     * @throws \Exception Is thrown, if the path can not be mapped
261
     */
262
    public function mapPathEntityId($path)
263
    {
264
265
        // query whether or not a entity ID for the passed path has been mapped
266
        if (isset($this->pathEntityIdMapping[$unifiedPath = $this->unifyPath($path)])) {
267
            return $this->pathEntityIdMapping[$unifiedPath];
268
        }
269
270
        // throw an exception if not
271
        throw new \Exception(
272
            $this->appendExceptionSuffix(
273
                sprintf('Can\'t map path %s to any entity ID', $path)
274
            )
275
        );
276
    }
277
278
    /**
279
     * Add the passed path => store view code mapping.
@@ 397-411 (lines=15) @@
394
     * @return integer The store website ID
395
     * @throws \Exception Is thrown, if the store website with the requested code is not available
396
     */
397
    public function getStoreWebsiteIdByCode($code)
398
    {
399
400
        // query whether or not, the requested store website is available
401
        if (isset($this->storeWebsites[$code])) {
402
            return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
403
        }
404
405
        // throw an exception, if not
406
        throw new \Exception(
407
            $this->appendExceptionSuffix(
408
                sprintf('Found invalid website code "%s"', $code)
409
            )
410
        );
411
    }
412
413
    /**
414
     * Return's the category with the passed path.

src/Subjects/BunchSubject.php 1 location

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