granam / string
轻量级字符串包装器
4.2.2
2023-10-20 07:40 UTC
Requires
- php: >=7.4
- ext-intl: *
- ext-mbstring: *
- granam/scalar: ^5.0
- granam/strict-object: >=3.0
Requires (Dev)
- granam/exceptions-hierarchy: ^5.0
- mockery/mockery: ^1.2
- phpunit/phpunit: >=9.0
- rector/rector: ^0.14.2
This package is auto-updated.
Last update: 2024-09-20 09:52:02 UTC
README
<?php use Granam\String\StringObject; use Granam\String\Exceptions\WrongParameterType; $string = new StringObject(12345.678); echo $string; // string '12345.678' try { new StringObject(fopen('foo', 'rb')); } catch (WrongParameterType $stringException) { // Expected scalar or object with \_\_toString method on strict mode, got resource. die('Something get wrong: ' . $stringException->getMessage()); }