Download the PHP package jrfnl/php-cast-to-type without Composer

On this page you can find all versions of the php package jrfnl/php-cast-to-type. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-cast-to-type

GitHub license CS Lint

PHP-cast-to-type

PHP Class to consistently cast variables to a specific type.

Returns either the value in the specified type or null.

Features:

Some Usage examples:

Available methods:

All methods are static.

Parameters:

Param Type Description
$value mixed Value to cast.
$type string Type to cast to. Valid values: 'bool', 'boolean', 'int', 'integer', 'float', 'double', 'num', 'string', 'array', 'object'.
$array2null bool Optional. Whether to return null for arrays when casting to bool, int, float, num or string. If false, the individual values held in the array will recursively be cast to the specified type. Defaults to true.
$allow_empty bool Optional. Whether to allow empty strings, empty arrays, empty objects. If false, null will be returned instead of the empty string/array/object. Defaults to true.

Installation

Requirements

This package requires the PHP native ctype extension.

Stand-alone

  1. Head to the Releases page and download the latest release zip.
  2. Extract the files and place them somewhere in your project hierarchy.
  3. Require the class loader using require_once '/path/to/cast-to-type.php';.

Composer

If you are using PHP5+ (as you should), PHP-Cast-to_Type is also available as a package installable via Composer:

Changelog:

2.1.0 (Nov 2022)

2.0.1 (Jan 2018)

2.0 (Jun 2015)

1.0 (2006 / Sept 2013)


All versions of php-cast-to-type with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0
ext-ctype Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jrfnl/php-cast-to-type contains the following files

Loading the files please wait ....