Download the PHP package smoren/type-tools without Composer

On this page you can find all versions of the php package smoren/type-tools. 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 type-tools

PHP Type Tools

Packagist PHP Version Support Scrutinizer Code Quality Coverage Status Build and test License: MIT

Helpers for different operations with PHP data types, variables and containers.

How to install to your project

Quick Reference

Unique Extractor

Method Description Code Snippet
getString Returns unique string of the given variable UniqueExtractor::getString($var, $strict)
getHash Returns unique md5 hash string of the given variable UniqueExtractor::getHash($var, $strict)

Object Type Caster

Method Description Code Snippet
cast Cast object to another relative type ObjectTypeCaster::cast($sourceObject, $destinationClass)

Object Access

Method Description Code Snippet
getPropertyValue Returns value of the object property ObjectAccess::getPropertyValue($object, $propertyName)
setPropertyValue Sets value of the object property ObjectAccess::setPropertyValue($object, $propertyName, $value)
hasReadableProperty Returns true if object has readable property by name or by getter ObjectAccess::hasReadableProperty($object, $propertyName)
hasWritableProperty Returns true if object has writable property by name or by getter ObjectAccess::hasWritableProperty($object, $propertyName)
hasPublicProperty Returns true if object has public property ObjectAccess::hasPublicProperty($object, $propertyName)
hasPublicMethod Returns true if object has public method ObjectAccess::hasPublicMethod($object, $methodName)
hasProperty Returns true if object has property ObjectAccess::hasProperty($object, $propertyName)
hasMethod Returns true if object has method ObjectAccess::hasMethod($object, $methodName)

Map Access

Method Description Code Snippet
get Returns value from the container by key MapAccess::get($container, $key, $defaultValue)
set Sets value to the container by key MapAccess::set($container, $key, $value)
exists Returns true if accessible key exists in the container MapAccess::exists($container, $key)

Usage

Unique Extractor

Tool for extracting unique IDs and hashes of any PHP variables and data structures.

Works in two modes: strict and non-strict.

In strict mode:

In non-strict mode:

Get String

Returns unique string of the given variable.

Get Hash

Returns unique md5 hash string of the given variable.

Object Type Caster

Tool for casting types of objects.

Cast

Cast object to another relative type (upcast or downcast).

Object Access

Tool for reflecting and accessing object properties and methods.

Get Property Value

Returns value of the object property.

Can access property by its name or by getter.

Throws Smoren\TypeTools\Exceptions\KeyError if property is not accessible to read.

Set Property Value

Sets value of the object property.

Can access property by its name or by setter.

Throws Smoren\TypeTools\Exceptions\KeyError if property is not accessible to write.

Has Readable Property

Returns true if object has property that is readable by name or by getter.

Has Writable Property

Returns true if object has property that is writable by name or by setter.

Has Public Property

Returns true if object has public property.

Has Public Method

Returns true if object has public method.

Has Property

Returns true if object has property.

Has Method

Returns true if object has method.

Map Access

Tool for map-like accessing of different containers by string keys.

Can access:

Get

Returns value from the container by key or default value if key does not exist or not accessible.

Throws Smoren\TypeTools\Exceptions\KeyError if key is not accessible to read.

Set

Sets value to the container by key.

Throws Smoren\TypeTools\Exceptions\KeyError if key is not accessible to write.

Exists

Returns true if accessible key exists in the container.

Unit testing

License

PHP Type Tools is licensed under the MIT License.


All versions of type-tools with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
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 smoren/type-tools contains the following files

Loading the files please wait ....