typing / types
PHP primitive wrappers lib.
Requires
- php: >=8.0
- ext-mbstring: *
- cocur/slugify: ^4.0
- composer/semver: ^3.2
- doctrine/collections: ^1.6
- doctrine/inflector: ^2.0
- myclabs/php-enum: ^1.8
- nesbot/carbon: ^2.49
- symfony/polyfill-ctype: ^1.23
- symfony/polyfill-mbstring: ^1.23
Requires (Dev)
- ext-bcmath: *
- ext-gmp: *
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.1
- escapestudios/symfony2-coding-standard: ^3.12
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.4
- pdepend/pdepend: dev-master as 2.9.2
- phpmd/phpmd: ^2.10
- phpro/grumphp: ^1.3
- phpstan/phpstan: ~0.12
- phpunit/phpunit: ^9.5
- povils/phpmnd: dev-master as 2.5
- sebastian/phpcpd: ^6.0
- tm/tooly-composer-script: ^1.4
Suggests
- ext-bcmath: *
- ext-gmp: *
- moneyphp/money: ^1.2
This package is auto-updated.
Last update: 2024-11-29 06:29:52 UTC
README
PHP Primitive wrappers.
Description
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.
Documentation
Full docs
Please see the online documentation
Requirements
PHP 8.0 or above.
Optional Requirements:
Installation
Using CLI:
composer require typing/types:*@stable
Or directly on the composer.json
file:
{ "require": { "typing/types": "*@stable" } }
See https://getcomposer.org/ for more information and documentation.
Contributing
For locally testing workflows, use Act workflow tester.
If you want to contribute, please read the CONTRIBUTING.
License
This library is released under the MIT license. See the complete license in the LICENSE file.