Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

@@ 772-780 (lines=9) @@
769
     *
770
     * @throws InvalidArgumentException
771
     */
772
    public static function ip($value, $message = '')
773
    {
774
        if (false === \filter_var($value, \FILTER_VALIDATE_IP)) {
775
            static::reportInvalidArgument(\sprintf(
776
                $message ?: 'Expected a value to be an IP. Got: %s',
777
                static::valueToString($value)
778
            ));
779
        }
780
    }
781
782
    /**
783
     * @param mixed  $value
@@ 788-796 (lines=9) @@
785
     *
786
     * @throws InvalidArgumentException
787
     */
788
    public static function ipv4($value, $message = '')
789
    {
790
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
791
            static::reportInvalidArgument(\sprintf(
792
                $message ?: 'Expected a value to be an IPv4. Got: %s',
793
                static::valueToString($value)
794
            ));
795
        }
796
    }
797
798
    /**
799
     * @param mixed  $value
@@ 804-812 (lines=9) @@
801
     *
802
     * @throws InvalidArgumentException
803
     */
804
    public static function ipv6($value, $message = '')
805
    {
806
        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
807
            static::reportInvalidArgument(\sprintf(
808
                $message ?: 'Expected a value to be an IPv6. Got %s',
809
                static::valueToString($value)
810
            ));
811
        }
812
    }
813
814
    /**
815
     * @param mixed  $value
@@ 820-828 (lines=9) @@
817
     *
818
     * @throws InvalidArgumentException
819
     */
820
    public static function email($value, $message = '')
821
    {
822
        if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
823
            static::reportInvalidArgument(\sprintf(
824
                $message ?: 'Expected a value to be a valid e-mail address. Got %s',
825
                static::valueToString($value)
826
            ));
827
        }
828
    }
829
830
    /**
831
     * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.