Code Duplication    Length = 15-15 lines in 3 locations

src/Subjects/BunchSubject.php 1 location

@@ 352-366 (lines=15) @@
349
     * @return array The requested entity type
350
     * @throws \Exception Is thrown, if the requested entity type is not available
351
     */
352
    protected function getEntityType()
353
    {
354
355
        // query whether or not the entity type with the passed code is available
356
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
357
            return $this->entityTypes[$entityTypeCode];
358
        }
359
360
        // throw a new exception
361
        throw new \Exception(
362
            $this->appendExceptionSuffix(
363
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
364
            )
365
        );
366
    }
367
368
    /**
369
     * Return's TRUE, if the passed URL key varchar value IS related with the actual PK.

src/Subjects/AbstractProductSubject.php 2 locations

@@ 441-455 (lines=15) @@
438
     * @return integer The tax class ID
439
     * @throws \Exception Is thrown, if the tax class with the requested name is not available
440
     */
441
    public function getTaxClassIdByTaxClassName($taxClassName)
442
    {
443
444
        // query whether or not, the requested tax class is available
445
        if (isset($this->taxClasses[$taxClassName])) {
446
            return (integer) $this->taxClasses[$taxClassName][MemberNames::CLASS_ID];
447
        }
448
449
        // throw an exception, if not
450
        throw new \Exception(
451
            $this->appendExceptionSuffix(
452
                sprintf('Found invalid tax class name %s', $taxClassName)
453
            )
454
        );
455
    }
456
457
    /**
458
     * Return's the store website for the passed code.
@@ 465-479 (lines=15) @@
462
     * @return integer The store website ID
463
     * @throws \Exception Is thrown, if the store website with the requested code is not available
464
     */
465
    public function getStoreWebsiteIdByCode($code)
466
    {
467
468
        // query whether or not, the requested store website is available
469
        if (isset($this->storeWebsites[$code])) {
470
            return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
471
        }
472
473
        // throw an exception, if not
474
        throw new \Exception(
475
            $this->appendExceptionSuffix(
476
                sprintf('Found invalid website code %s', $code)
477
            )
478
        );
479
    }
480
481
    /**
482
     * Return's the category with the passed path.