Code Duplication    Length = 9-11 lines in 2 locations

src/Filterer.php 2 locations

@@ 652-660 (lines=9) @@
649
        return $customError;
650
    }
651
652
    private static function getAllowUnknowns(array $options) : bool
653
    {
654
        $allowUnknowns = $options[FiltererOptions::ALLOW_UNKNOWNS];
655
        if ($allowUnknowns !== false && $allowUnknowns !== true) {
656
            throw new InvalidArgumentException(sprintf("'%s' option was not a bool", FiltererOptions::ALLOW_UNKNOWNS));
657
        }
658
659
        return $allowUnknowns;
660
    }
661
662
    private static function getDefaultRequired(array $options) : bool
663
    {
@@ 662-672 (lines=11) @@
659
        return $allowUnknowns;
660
    }
661
662
    private static function getDefaultRequired(array $options) : bool
663
    {
664
        $defaultRequired = $options[FiltererOptions::DEFAULT_REQUIRED];
665
        if ($defaultRequired !== false && $defaultRequired !== true) {
666
            throw new InvalidArgumentException(
667
                sprintf("'%s' option was not a bool", FiltererOptions::DEFAULT_REQUIRED)
668
            );
669
        }
670
671
        return $defaultRequired;
672
    }
673
674
    /**
675
     * @param string         $responseType   The type of object that should be returned.