Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

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