Code Duplication    Length = 9-9 lines in 4 locations

src/Assert.php 4 locations

@@ 476-484 (lines=9) @@
473
        }
474
    }
475
476
    public static function ip($value, $message = '')
477
    {
478
        if (false === filter_var($value, FILTER_VALIDATE_IP)) {
479
            static::reportInvalidArgument(sprintf(
480
                $message ?: 'Expected a value to be an IP. Got: %s',
481
                static::valueToString($value)
482
            ));
483
        }
484
    }
485
486
    public static function ipv4($value, $message = '')
487
    {
@@ 486-494 (lines=9) @@
483
        }
484
    }
485
486
    public static function ipv4($value, $message = '')
487
    {
488
        if (false === filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
489
            static::reportInvalidArgument(sprintf(
490
                $message ?: 'Expected a value to be an IPv4. Got: %s',
491
                static::valueToString($value)
492
            ));
493
        }
494
    }
495
496
    public static function ipv6($value, $message = '')
497
    {
@@ 496-504 (lines=9) @@
493
        }
494
    }
495
496
    public static function ipv6($value, $message = '')
497
    {
498
        if (false === filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
499
            static::reportInvalidArgument(sprintf(
500
                $message ?: 'Expected a value to be an IPv6. Got %s',
501
                static::valueToString($value)
502
            ));
503
        }
504
    }
505
506
    public static function email($value, $message = '')
507
    {
@@ 506-514 (lines=9) @@
503
        }
504
    }
505
506
    public static function email($value, $message = '')
507
    {
508
        if (false === filter_var($value, FILTER_VALIDATE_EMAIL)) {
509
            static::reportInvalidArgument(sprintf(
510
                $message ?: 'Expected a value to be a valid e-mail address. Got %s',
511
                static::valueToString($value)
512
            ));
513
        }
514
    }
515
516
    public static function uniqueValues(array $values, $message = '')
517
    {