@@ 668-677 (lines=10) @@ | ||
665 | } |
|
666 | } |
|
667 | ||
668 | public static function endsWith($value, $suffix, $message = '') |
|
669 | { |
|
670 | if ($suffix !== substr($value, -static::strlen($suffix))) { |
|
671 | static::reportInvalidArgument(sprintf( |
|
672 | $message ?: 'Expected a value to end with %2$s. Got: %s', |
|
673 | static::valueToString($value), |
|
674 | static::valueToString($suffix) |
|
675 | )); |
|
676 | } |
|
677 | } |
|
678 | ||
679 | public static function regex($value, $pattern, $message = '') |
|
680 | { |
|
@@ 910-919 (lines=10) @@ | ||
907 | } |
|
908 | } |
|
909 | ||
910 | public static function implementsInterface($value, $interface, $message = '') |
|
911 | { |
|
912 | if (!in_array($interface, class_implements($value))) { |
|
913 | static::reportInvalidArgument(sprintf( |
|
914 | $message ?: 'Expected an implementation of %2$s. Got: %s', |
|
915 | static::valueToString($value), |
|
916 | static::valueToString($interface) |
|
917 | )); |
|
918 | } |
|
919 | } |
|
920 | ||
921 | public static function propertyExists($classOrObject, $property, $message = '') |
|
922 | { |