Repository navigation
v1.0.0-RC2
Pre-release
Pre-release
Second release candidate of Solo Input (solophp/input). It adds the built-in cast #[Cast('decimal')], which moving the first real application to RC1 called for: a number for a DECIMAL column, bcmath or a decimal library, written in plain decimal notation instead of the exponent notation PHP gives a small float.
This is a prerelease: the 1.0 API is being validated in real applications before the stable 1.0.0 tag.
Changes since 1.0.0-RC1
#[Cast('decimal')]on astring(or untyped /mixed) property writes a number in plain decimal notation:0.00001and'1e-5'as'0.00001', where thestringcast gives'1.0E-5'. An int or a numeric string keeps every digit it has, and a float gives its shortest round-trip digits, so0.1stays'0.1'.""is no value, as forintandfloat. Input that is no number, or a number a float overflows to infinity or rounds to zero although it is not zero, failsnumeric. The schema reports such a field withcast: 'decimal'. See Type Casting → Decimal.- A property typed with a class named like a built-in cast (
json,decimal) fails metadata building withConfigurationException, like any class no input can produce, instead of being cast as that type.
Install
composer require 'solophp/input:^1.0@RC'See the documentation and the full diff since RC1.