Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

@@ 848-856 (lines=9) @@
845
     *
846
     * @throws InvalidArgumentException
847
     */
848
    public static function ip($value, $message = '')
849
    {
850
        if (false === \filter_var($value, \FILTER_VALIDATE_IP)) {
851
            static::reportInvalidArgument(\sprintf(
852
                $message ?: 'Expected a value to be an IP. Got: %s',
853
                static::valueToString($value)
854
            ));
855
        }
856
    }
857
858
    /**
859
     * @param mixed  $value
@@ 864-872 (lines=9) @@
861
     *
862
     * @throws InvalidArgumentException
863
     */
864
    public static function ipv4($value, $message = '')
865
    {
866
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
867
            static::reportInvalidArgument(\sprintf(
868
                $message ?: 'Expected a value to be an IPv4. Got: %s',
869
                static::valueToString($value)
870
            ));
871
        }
872
    }
873
874
    /**
875
     * @param mixed  $value
@@ 880-888 (lines=9) @@
877
     *
878
     * @throws InvalidArgumentException
879
     */
880
    public static function ipv6($value, $message = '')
881
    {
882
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
883
            static::reportInvalidArgument(\sprintf(
884
                $message ?: 'Expected a value to be an IPv6. Got %s',
885
                static::valueToString($value)
886
            ));
887
        }
888
    }
889
890
    /**
891
     * @param mixed  $value
@@ 896-904 (lines=9) @@
893
     *
894
     * @throws InvalidArgumentException
895
     */
896
    public static function email($value, $message = '')
897
    {
898
        if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
899
            static::reportInvalidArgument(\sprintf(
900
                $message ?: 'Expected a value to be a valid e-mail address. Got %s',
901
                static::valueToString($value)
902
            ));
903
        }
904
    }
905
906
    /**
907
     * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.