granam / string
Lightweight string wrapper
Installs: 24 802
Dependents: 25
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
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-12-20 10:21:53 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()); }