Code Duplication    Length = 10-10 lines in 4 locations

src/Api/Config/Config.php 4 locations

@@ 642-651 (lines=10) @@
639
     *
640
     * @throws InvalidConfigException If the config value isn't an array.
641
     */
642
    private function assertArray($key, $value)
643
    {
644
        if (!is_array($value)) {
645
            throw new InvalidConfigException(sprintf(
646
                'The config key "%s" must be an array. Got: %s',
647
                $key,
648
                is_object($value) ? get_class($value) : gettype($value)
649
            ));
650
        }
651
    }
652
653
    /**
654
     * @param string $key
@@ 676-685 (lines=10) @@
673
     *
674
     * @throws InvalidConfigException If the config value isn't a string.
675
     */
676
    private function assertString($key, $value)
677
    {
678
        if (!is_string($value) && null !== $value) {
679
            throw new InvalidConfigException(sprintf(
680
                'The config key "%s" must be a string. Got: %s',
681
                $key,
682
                is_object($value) ? get_class($value) : gettype($value)
683
            ));
684
        }
685
    }
686
687
    /**
688
     * @param string $key
@@ 693-702 (lines=10) @@
690
     *
691
     * @throws InvalidConfigException If the config value isn't an integer.
692
     */
693
    private function assertInteger($key, $value)
694
    {
695
        if (!is_int($value) && null !== $value) {
696
            throw new InvalidConfigException(sprintf(
697
                'The config key "%s" must be an integer. Got: %s',
698
                $key,
699
                is_object($value) ? get_class($value) : gettype($value)
700
            ));
701
        }
702
    }
703
704
    /**
705
     * @param string $key
@@ 710-719 (lines=10) @@
707
     *
708
     * @throws InvalidConfigException If the config value isn't a boolean.
709
     */
710
    private function assertBoolean($key, $value)
711
    {
712
        if (!is_bool($value) && null !== $value) {
713
            throw new InvalidConfigException(sprintf(
714
                'The config key "%s" must be a bool. Got: %s',
715
                $key,
716
                is_object($value) ? get_class($value) : gettype($value)
717
            ));
718
        }
719
    }
720
721
    /**
722
     * @param string $key