Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

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