Code Duplication    Length = 10-10 lines in 2 locations

src/Assert.php 2 locations

@@ 620-629 (lines=10) @@
617
        }
618
    }
619
620
    public static function endsWith($value, $suffix, $message = '')
621
    {
622
        if ($suffix !== substr($value, -static::strlen($suffix))) {
623
            static::reportInvalidArgument(sprintf(
624
                $message ?: 'Expected a value to end with %2$s. Got: %s',
625
                static::valueToString($value),
626
                static::valueToString($suffix)
627
            ));
628
        }
629
    }
630
631
    public static function regex($value, $pattern, $message = '')
632
    {
@@ 840-849 (lines=10) @@
837
        }
838
    }
839
840
    public static function implementsInterface($value, $interface, $message = '')
841
    {
842
        if (!in_array($interface, class_implements($value))) {
843
            static::reportInvalidArgument(sprintf(
844
                $message ?: 'Expected an implementation of %2$s. Got: %s',
845
                static::valueToString($value),
846
                static::valueToString($interface)
847
            ));
848
        }
849
    }
850
851
    public static function propertyExists($classOrObject, $property, $message = '')
852
    {