Download the PHP package douglasgreen/utility without Composer
On this page you can find all versions of the php package douglasgreen/utility. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download douglasgreen/utility
More information about douglasgreen/utility
Files in douglasgreen/utility
Download douglasgreen/utility
More information about douglasgreen/utility
Files in douglasgreen/utility
Vendor douglasgreen
Package utility
Short Description PHP utility project for exception classes and wrapper functions
License MIT
Homepage https://github.com/douglasgreen/utility
Package utility
Short Description PHP utility project for exception classes and wrapper functions
License MIT
Homepage https://github.com/douglasgreen/utility
Please rate this library. Is it a good library?
Informations about the package utility
utility
A PHP utility project for exception classes and wrapper functions
Setup
Add the project with Composer.
Benefits
PHP has an old core design dating back to its PHP 3 era. Examples include:
- Using functions instead of classes.
- Returning mixed types from functions.
- Returning false, null, or empty array to supress errors.
- Inconsistent function names and arguments.
- Returning arrays or resources from functions instead of objects.
- A mixture of mutable arguments and return values.
Even worse, the language introduced static typing and strict type checking tools.
- Returning false|string doesn't make sense and should return ?string.
- Type checkers force you to work harder to ignore errors using strict comparisons.
These utility classes wrap the PHP function calls and try to fix these problems.
Function signatures
The functions were renamed for clarity. Function argument order was preserved, except:
- Mutable arguments are now return values on getter functions.
- If a signal value is returned, return null rather than false.
- Arrays with multiple shapes and types were reduced to a single shape and type.
All versions of utility with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package douglasgreen/utility contains the following files
Loading the files please wait ....