@@ 738-747 (lines=10) @@ | ||
735 | } |
|
736 | } |
|
737 | ||
738 | public static function endsWith($value, $suffix, $message = '') |
|
739 | { |
|
740 | if ($suffix !== substr($value, -static::strlen($suffix))) { |
|
741 | static::reportInvalidArgument(sprintf( |
|
742 | $message ?: 'Expected a value to end with %2$s. Got: %s', |
|
743 | static::valueToString($value), |
|
744 | static::valueToString($suffix) |
|
745 | )); |
|
746 | } |
|
747 | } |
|
748 | ||
749 | public static function regex($value, $pattern, $message = '') |
|
750 | { |
|
@@ 980-989 (lines=10) @@ | ||
977 | } |
|
978 | } |
|
979 | ||
980 | public static function implementsInterface($value, $interface, $message = '') |
|
981 | { |
|
982 | if (!in_array($interface, class_implements($value))) { |
|
983 | static::reportInvalidArgument(sprintf( |
|
984 | $message ?: 'Expected an implementation of %2$s. Got: %s', |
|
985 | static::valueToString($value), |
|
986 | static::valueToString($interface) |
|
987 | )); |
|
988 | } |
|
989 | } |
|
990 | ||
991 | public static function propertyExists($classOrObject, $property, $message = '') |
|
992 | { |