Skip to content

typedphp/type-functions

Repository files navigation

Type Functions

Build Status Code Quality Code Coverage Version License

Example

use TypedPHP\Functions\TypeFunctions;

TypeFunctions\getType(1.5); // number

TypeFunctions\isBoolean(false);   // true
TypeFunctions\isBoolean("false"); // false

Functions:

  • isNumber
  • isBoolean
  • isNull
  • isObject
  • isFunction
  • isExpression
  • isString
  • isResource
  • getType

Caveats:

  • isExpression will return false if isString returns true.
  • isFunction will return false if isObject returns true.
  • getType will return unknown if the argument is not matched by any of the is* functions.

Installation

❯ composer require "typedphp/type-functions:*"

Testing

❯ composer create-project "typedphp/type-functions:*" .
❯ vendor/bin/phpunit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages