@@ 534-543 (lines=10) @@ | ||
531 | } |
|
532 | } |
|
533 | ||
534 | public static function endsWith($value, $suffix, $message = '') |
|
535 | { |
|
536 | if ($suffix !== substr($value, -static::strlen($suffix))) { |
|
537 | static::reportInvalidArgument(sprintf( |
|
538 | $message ?: 'Expected a value to end with %2$s. Got: %s', |
|
539 | static::valueToString($value), |
|
540 | static::valueToString($suffix) |
|
541 | )); |
|
542 | } |
|
543 | } |
|
544 | ||
545 | public static function regex($value, $pattern, $message = '') |
|
546 | { |
|
@@ 754-763 (lines=10) @@ | ||
751 | } |
|
752 | } |
|
753 | ||
754 | public static function implementsInterface($value, $interface, $message = '') |
|
755 | { |
|
756 | if (!in_array($interface, class_implements($value))) { |
|
757 | static::reportInvalidArgument(sprintf( |
|
758 | $message ?: 'Expected an implementation of %2$s. Got: %s', |
|
759 | static::valueToString($value), |
|
760 | static::valueToString($interface) |
|
761 | )); |
|
762 | } |
|
763 | } |
|
764 | ||
765 | public static function propertyExists($classOrObject, $property, $message = '') |
|
766 | { |