Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

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