| @@ 979-988 (lines=10) @@ | ||
| 976 | * @param string $suffix |
|
| 977 | * @param string $message |
|
| 978 | */ |
|
| 979 | public static function endsWith($value, $suffix, $message = '') |
|
| 980 | { |
|
| 981 | if ($suffix !== \substr($value, -\strlen($suffix))) { |
|
| 982 | static::reportInvalidArgument(\sprintf( |
|
| 983 | $message ?: 'Expected a value to end with %2$s. Got: %s', |
|
| 984 | static::valueToString($value), |
|
| 985 | static::valueToString($suffix) |
|
| 986 | )); |
|
| 987 | } |
|
| 988 | } |
|
| 989 | ||
| 990 | /** |
|
| 991 | * @param mixed $value |
|
| @@ 1340-1349 (lines=10) @@ | ||
| 1337 | * @param mixed $interface |
|
| 1338 | * @param string $message |
|
| 1339 | */ |
|
| 1340 | public static function implementsInterface($value, $interface, $message = '') |
|
| 1341 | { |
|
| 1342 | if (!\in_array($interface, \class_implements($value))) { |
|
| 1343 | static::reportInvalidArgument(\sprintf( |
|
| 1344 | $message ?: 'Expected an implementation of %2$s. Got: %s', |
|
| 1345 | static::valueToString($value), |
|
| 1346 | static::valueToString($interface) |
|
| 1347 | )); |
|
| 1348 | } |
|
| 1349 | } |
|
| 1350 | ||
| 1351 | /** |
|
| 1352 | * @param string|object $classOrObject |
|