Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

@@ 727-735 (lines=9) @@
724
     *
725
     * @throws InvalidArgumentException
726
     */
727
    public static function ip($value, $message = '')
728
    {
729
        if (false === \filter_var($value, \FILTER_VALIDATE_IP)) {
730
            static::reportInvalidArgument(\sprintf(
731
                $message ?: 'Expected a value to be an IP. Got: %s',
732
                static::valueToString($value)
733
            ));
734
        }
735
    }
736
737
    /**
738
     * @param mixed                    $value
@@ 743-751 (lines=9) @@
740
     *
741
     * @throws InvalidArgumentException
742
     */
743
    public static function ipv4($value, $message = '')
744
    {
745
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
746
            static::reportInvalidArgument(\sprintf(
747
                $message ?: 'Expected a value to be an IPv4. Got: %s',
748
                static::valueToString($value)
749
            ));
750
        }
751
    }
752
753
    /**
754
     * @param mixed                    $value
@@ 759-767 (lines=9) @@
756
     *
757
     * @throws InvalidArgumentException
758
     */
759
    public static function ipv6($value, $message = '')
760
    {
761
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
762
            static::reportInvalidArgument(\sprintf(
763
                $message ?: 'Expected a value to be an IPv6. Got: %s',
764
                static::valueToString($value)
765
            ));
766
        }
767
    }
768
769
    /**
770
     * @param mixed                    $value
@@ 775-783 (lines=9) @@
772
     *
773
     * @throws InvalidArgumentException
774
     */
775
    public static function email($value, $message = '')
776
    {
777
        if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
778
            static::reportInvalidArgument(\sprintf(
779
                $message ?: 'Expected a value to be a valid e-mail address. Got: %s',
780
                static::valueToString($value)
781
            ));
782
        }
783
    }
784
785
    /**
786
     * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.