granam / strict-string
1.2.2
2015-09-16 14:57 UTC
Requires
- php: >=5.4
- granam/exception-hierarchy: ~2.1
- granam/scalar: ~1.0
- granam/strict-object: ~1.1
- granam/strict-scalar: ~2.0
- granam/string: ~1.0
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~4.4
README
注意:需要 PHP 5.4+
<?php use Granam\Strict\String\StrictString; use Granam\Strict\String\Exceptions\WrongParameterType; $string = new StrictString('12345'); // foo echo $string; try { new StrictString(12345); } catch (WrongParameterType $stringException) { // Strict string has to get a string value. Integer is not a string. die('Something get wrong: ' . $stringException->getMessage()); }