| @@ 1264-1273 (lines=10) @@ | ||
| 1261 | * | |
| 1262 | * @throws InvalidArgumentException | |
| 1263 | */ | |
| 1264 | public static function endsWith($value, $suffix, $message = '') | |
| 1265 |     { | |
| 1266 |         if ($suffix !== \substr($value, -\strlen($suffix))) { | |
| 1267 | static::reportInvalidArgument(\sprintf( | |
| 1268 | $message ?: 'Expected a value to end with %2$s. Got: %s', | |
| 1269 | static::valueToString($value), | |
| 1270 | static::valueToString($suffix) | |
| 1271 | )); | |
| 1272 | } | |
| 1273 | } | |
| 1274 | ||
| 1275 | /** | |
| 1276 | * @psalm-pure | |
| @@ 1284-1293 (lines=10) @@ | ||
| 1281 | * | |
| 1282 | * @throws InvalidArgumentException | |
| 1283 | */ | |
| 1284 | public static function notEndsWith($value, $suffix, $message = '') | |
| 1285 |     { | |
| 1286 |         if ($suffix === \substr($value, -\strlen($suffix))) { | |
| 1287 | static::reportInvalidArgument(\sprintf( | |
| 1288 | $message ?: 'Expected a value not to end with %2$s. Got: %s', | |
| 1289 | static::valueToString($value), | |
| 1290 | static::valueToString($suffix) | |
| 1291 | )); | |
| 1292 | } | |
| 1293 | } | |
| 1294 | ||
| 1295 | /** | |
| 1296 | * @psalm-pure | |
| @@ 1719-1728 (lines=10) @@ | ||
| 1716 | * | |
| 1717 | * @throws InvalidArgumentException | |
| 1718 | */ | |
| 1719 | public static function implementsInterface($value, $interface, $message = '') | |
| 1720 |     { | |
| 1721 |         if (!\in_array($interface, \class_implements($value))) { | |
| 1722 | static::reportInvalidArgument(\sprintf( | |
| 1723 | $message ?: 'Expected an implementation of %2$s. Got: %s', | |
| 1724 | static::valueToString($value), | |
| 1725 | static::valueToString($interface) | |
| 1726 | )); | |
| 1727 | } | |
| 1728 | } | |
| 1729 | ||
| 1730 | /** | |
| 1731 | * @psalm-pure | |