Download the PHP package plook/type-guard without Composer
On this page you can find all versions of the php package plook/type-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download plook/type-guard
More information about plook/type-guard
Files in plook/type-guard
Download plook/type-guard
More information about plook/type-guard
Files in plook/type-guard
Vendor plook
Package type-guard
Short Description Library to ensure correctness of types with a readable interface.
License LGPL-2.1-or-later
Package type-guard
Short Description Library to ensure correctness of types with a readable interface.
License LGPL-2.1-or-later
Please rate this library. Is it a good library?
Informations about the package type-guard
Type Guard
A PHP library to ensure correctness of types providing a readable interface.
Installation
Example
Provided helper functions
Ensure Types
asBool($value)
Converts input value to a boolean, but passesnull
.asFloat($value)
Converts input value to a float, but passesnull
.asInt($value)
Converts input value to a int, but passesnull
.asDateTimeImmutable($value)
Converts input value to aDateTimeImmutable
object, but passesnull
.asDateTimeString($value)
Converts input value to a date string including the timezone, but passesnull
.asString($value)
Converts input value to a string, but passesnull
.
Assertions
notNull($value)
Throws an exception if the value isnull
otherwise it passes the original value.
Configuration
Setting the default target time zone of DateTimeImmutable
objects
Setting the default format of date time strings
All versions of type-guard with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
The package plook/type-guard contains the following files
Loading the files please wait ....