Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

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