Download the PHP package bocharsky-bw/arrayzy without Composer

On this page you can find all versions of the php package bocharsky-bw/arrayzy. 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 arrayzy

Arrayzy

The wrapper for all PHP built-in array functions and easy, object-oriented array manipulation library. In short: Arrays on steroids.

Travis Status HHVM Status Scrutinizer Code Quality Code Coverage Software License Latest Version

SensioLabsInsight

ArrayImitator

This is the main class of this library. Each method, which associated with the corresponding native PHP function, keep its behavior. In other words: methods could creates a new array (leaving the original array unchanged), operates on the same array (returns the array itself and DOES NOT create a new instance) or return some result.

NOTE: If method creates a new array but you don't need the first array you operate on, you can override it manually:

NOTE: If method operates on the same array but you need to keep the first array you operate on as unchanged, you can clone it manually first:

Contents

Requirements

Installation

The preferred way to install this package is to use Composer:

If you don't use Composer - register this package in your autoloader manually or download this library and require the necessary files directly in your scripts:

Creation

Create a new empty array with the new statement.

NOTE: Don't forget about namespaces. You can use namespace aliases for simplicity if you want:

Create a new array with default values, passed it to the constructor as an array:

Also, new objects can be created with one of the public static methods prefixed with 'create':

Usage

You can get access to the values like with the familiar PHP array syntax:

NOTE: The following methods and principles apply to the ArrayImitator class. In the examples provided below the ArrayImitator aliased with A.

Chaining

Methods may be chained for ease of use:

Converting

Easily convert instance array elements to a simple PHP array, string, readable string or JSON format:

Debugging

Public method list

add

Associated with $a[] = 'new item'.

chunk

Associated with array_chunk().

clear

Associated with $a = [].

combine

Associated with array_combine().

contains

Associated with in_array().

containsKey

Associated with array_key_exists().

count

Associated with count().

create

createClone

Creates a shallow copy of the array.

Keep in mind, that in PHP variables contain only references to the object, NOT the object itself:

So if you DO NOT want to modify the current array, you need to clone it manually first:

createFromJson

Associated with json_decode().

Creates an array by parsing a JSON string:

createFromObject

Creates an instance array from any object that implemented \ArrayAccess interface:

createFromString

Associated with explode().

Creates an array from a simple PHP string with specified separator:

createWithRange

Associated with range().

Creates an array of a specified range:

current

Associated with current().

Position of the iterator.

customSort

Associated with usort().

customSortKeys

Associated with uksort().

debug

Associated with print_r().

diff

Associated with array_diff().

each

Associated with each().

end

Associated with end().

except

Based on array_diff_key().

Chunk of an array without given keys.

exists

A custom contains method where you can supply your own custom logic in any callable function.

export

Associated with var_export().

filter

Associated with array_filter().

find

A custom find method where you can supply your own custom logic in any callable function.

first

Alias of reset.

flip

Associated with array_flip().

getIterator

Creates an external Iterator. Check the iteratorAggregate documentation for more information.

getKeys

Associated with array_keys().

getRandom

Associated with array_rand().

getRandomKey

Associated with array_rand().

getRandomKeys

Associated with array_rand().

getRandomValues

Associated with array_rand().

getValues

Associated with array_values().

indexOf

Alias of search.

intersect

Associated with array_intersect().

intersectAssoc

Associated with array_intersect_assoc().

intersectKey

Associated with array_intersect_key().

isAssoc

Check whether all array keys are associative.

isEmpty

Check whether array is empty.

isNumeric

Check whether all array keys are numeric.

key

Associated with key().

last

Alias of end.

map

Associated with array_map().

merge

Associated with array_merge() / array_merge_recursive().

next

Associated with next().

offsetExists

Implemented for ArrayAccess interface.

offsetGet

Implemented for ArrayAccess interface.

offsetSet

Implemented for ArrayAccess interface.

offsetUnset

Implemented for ArrayAccess interface.

only

Based on array_intersect_key().

Chunk of an array with only given keys.

pad

Associated with array_pad().

pop

Associated with array_pop().

previous

Associated with prev().

push

Associated with array_push().

The push() method allows multiple arguments.

reduce

Associated with array_reduce().

reindex

Based on array_values().

replace

Associated with array_replace() / array_replace_recursive().

reset

Associated with reset().

reverse

Associated with array_reverse().

search

Associated with array_search().

shift

Associated with array_shift().

shuffle

Associated with shuffle().

slice

Associated with array_slice().

sort

Associated with arsort() / sort() / asort() / rsort().

sortKeys

Associated with ksort() / krsort().

toArray

Convert the array to a simple PHP array type:

toJson

Associated with json_encode().

Creates a JSON string from the array:

toReadableString

Based on implode().

Converts instance array to a readable PHP string:

toString

Associated with implode().

Converts instance array to a simple PHP string:

unique

Associated with array_unique().

unshift

Associated with array_unshift().

Method unshift() allow multiple arguments.

walk

Associated with array_walk() / array_walk_recursive().

Contribution

Feel free to submit an Issue or create a Pull Request if you find a bug or just want to propose an improvement suggestion.

In order to propose a new feature the best way is to submit an Issue and discuss it first.

Links

Arrayzy was inspired by Doctrine ArrayCollection class and Stringy library.

Look at the Stringy if you are looking for a PHP string manipulation library in an OOP way.

Move UP


All versions of arrayzy with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-json 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 bocharsky-bw/arrayzy contains the following files

Loading the files please wait ....