Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

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