typing/types

PHP primitive wrappers lib.

dev-master 2021-08-01 00:36 UTC

This package is auto-updated.

Last update: 2024-03-29 04:39:39 UTC


README

Gitter Documentation Build Job Patch Job License Issues Downloads Latest

Quality Gate Status Maintainability Rating Reliability Rating Security Rating Bugs Coverage Duplicated Lines (%) Lines of Code Technical Debt Vulnerabilities

PhpTyping

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.