Types is a library that provides a collection of useful primitive wrappers, similar to what other languages can do ( Java, etc). It fixes a few issues some internal functions have, and limits coercion around native PHP functions.
This library aggregates multiple PHP libraries and wraps them in a single repo, providing decorator classes / sub-types with some extra features.
SPL_Types has been broken since...forever. The last release was in 2012. No library has tried to do this since, and SPL_Types providing an empty interface for each primitive object was not terribly useful.
Libraries such as Doctrine/Collections, Stringy, PHPMoney/Money, MyClabs/Enum and others like them,
are infinitely more useful. They provide rich interfaces that allow you to breeze through coding as opposed
to trying to remember the name of specific functions for particular primitives.
Please see the online documentation
PHP 8.0 or above.
Using CLI:
composer require typing/types:*@stableOr directly on the composer.json file:
{
"require": {
"typing/types": "*@stable"
}
}See https://getcomposer.org/ for more information and documentation.
For locally testing workflows, use Act workflow tester.
If you want to contribute, please read the CONTRIBUTING.
This library is released under the MIT license. See the complete license in the LICENSE file.
