Basic Type Assert is a PHP package designed to simplify and enhance type assertions in your applications.
Install the package via Composer:
composer require badjacky/basic-type
Here is a basic usage example:
use function BadJacky\BasicType\type;
// Example usage
type(1)->asInt(); // 1
type(['a'])->asArray(); // ['a']
type('string')->asString(); // 'string'
type(1.1)->asFloat(); // 1.1
type(true)->asBool(); // true
type(null)->asNull(); // null
type(new stdClass())->asObject(); // stdClass
To run tests, use the following command:
composer test
See CHANGELOG for recent updates.
See CONTRIBUTING for contribution guidelines.
If you find any security-related issues, please email [email protected] instead of using the issue tracker.
- BadJacky
- All contributors
This project is licensed under the MIT License. See the LICENSE file for details.
This package was generated using the Laravel Package Boilerplate.