Download the PHP package chillerlan/php-traits without Composer
On this page you can find all versions of the php package chillerlan/php-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chillerlan/php-traits
More information about chillerlan/php-traits
Files in chillerlan/php-traits
Package php-traits
Short Description Some useful traits for PHP 7.2+
License MIT
Homepage https://github.com/chillerlan/php-traits
Informations about the package php-traits
chillerlan/php-traits
A collection of (more or less) useful traits for PHP7.2+
Features
ClassLoader- invokes objects of a given class and interface/type with an arbitrary count of constructor argumentsMagic- turns methods into magic propertiesEnumerable- provides some of prototype's enumerable methods, implementsEnumerableInterfaceArrayHelpersByteArray- useful for byte/bit-flipping purposes, extendsSplFixedArrayByteArrayDispenser- createsByteArrayfrom several data types (hex, base64, binary, json etc.)DotArray- adds dot key notation functionalitySearchableArray- deep search arrays usingRecursiveIteratorIterator
InterfacesArrayAccessTrait- implementsArrayAccessIteratorTrait- implementsIterator
SPLCountableTrait- implementsCountableSeekableIteratorTrait- implementsSeekableIterator
Documentation
Installation
requires composer
composer.json (note: replace dev-master with a version boundary)
Manual installation
Download the desired version of the package from master or release and extract the contents to your project folder. After that:
- run
composer installto install the required dependencies and generate/vendor/autoload.php. - if you use a custom autoloader, point the namespace
chillerlan\Traitsto the foldersrcof the package
Profit!
Usage
ClassLoader
Simple usage:
Let's assume we have several classes that implement the same interface, but their constructors have different parameter counts, like so:
Initialize an object based on a selction
Magic
Magic allows to access internal methods like as properties.
Enumerable
All versions of php-traits with dependencies
ext-json Version *