Download the PHP package novactive/collection without Composer

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

Branch Travis Sensio Insight Scrutinizer Quality Scrutinizer Coverage
develop Build Status SensioLabsInsight Scrutinizer Code Quality Code Coverage
master Build Status SensioLabsInsight Scrutinizer Code Quality Code Coverage

Nova Collection

Because we did not find any Collection for PHP as simple as we wanted, we did ours.

Simpler, Better, Faster, Stronger

Using *array_* functions against foreach* is not an easy pick. As this library is made to manage low level actions. We wanted it to be fast, then we compared and we implemented the best choices. (have a look: PHP7.2)

Fully unit tested it is reliable.

Methods

Advanced Selection by range

Result: [2,3,4,1,2,4,3,2,3,4,5,4,3,2,10]

Standard Manipulation Methods

Method Description
toArray() Get the raw Array.
set($key, $value) Set the value to the key no matter what.
get($key, $default) Get the value related to the key.
atIndex(int $index) Get the item at the given index (numerically).
keyOf($value) Get the key of a value if exists.
indexOf($value) Get the index of a value if exists (numerically).
containsKey($key) Test is the key exists.
contains($value) Test if this values exists.
add($item) Add a new value to the collection, next numeric index will be used. (in-place).
append(iterable $values) Append the items at the end of the collection not regarding the keys. (in-place).
clear() Clear the collection of all its items. (in-place).
remove($key) Remove the $key/value in the collection. (in-place).
pull($key) Remove the $key/value in the collection and return the removed value. (in-place).
first(callable $callback) Get the first time and reset and rewind.
shift() Shift an element off the beginning of the collection. (in-place).
pop() Shift an element off the end of the collection. (in-place).
last(callable $callback) Get the last item.
map(callable $callback) Map and return a new Collection.
mapKeys(callable $callback, callable $callbackValue) Map keys (and/or value) and return a new Collection.
transform(callable $callback) Map. (in-place).
filter(callable $callback) Filter and return a new Collection.
prune(callable $callback) Filter. (in-place).
combine(iterable $values, bool $inPlace) Combine and return a new Collection.
replace(iterable $values) Combine. (in-place).
combineKeys(iterable $keys) Opposite of Combine It keeps the values of the current Collection and assign new keys.
reindex(iterable $keys) CombineKeys. (in-place).
reduce(callable $callback, $initial) Reduce.
each(callable $callback) Run the callback on each element. (passive).
flip() Flip the keys and the values and return a new Collection.
invert() Flip. (in-place).
merge(iterable $items, bool $inPlace) Merge the items and the collections and return a new Collection.
coalesce(iterable $items) Merge. (in-place).
union(iterable $items, bool $inPlace) Union the collection with Items and return a new Collection.
absorb(iterable $items) Union. (in-place).
assert(callable $callback, bool $expected) Assert that the callback result is $expected for all.
values() Return all the values.
keys() Return all the keys.
pipe(callable $callback) Pass the collection to the given callback and return the result.
shuffle() Random. (in-place).
random() Shuffle and return a new Collection.
unique() Deduplicate the collection and return a new Collection.
implode(string $separator) Join the items using the $separator.
distinct() Unique. (in-place).
zip(iterable $items) Merge the values items by items and return a new Collection.
reverse() Reverse the collection and return a new Collection.
inverse() Reverse. (in-place).
isEmpty() Tells if the collection is empty.
split(int $count) Split in the collection in $count parts and return a new Collection.
chunk(int $size) Chunk of $size sub collection and return a new Collection.
slice(int $offset, int $length) Get a slice of the collection and inject it in a new Collection.
keep(int $offset, int $length) Keep a slice of the collection. (in-place).
applyOn($key, callable $onKeyFound, callable $onKeyNotFound) Apply the callback $onKeyFound on the key/value if the key exists. (passive).
cut(int $offset, int $length) Cut a slice of the collection. (in-place).
diff(iterable $items) Compares the collection against $items and returns the values that are not present in the collection.
diffKeys(iterable $items) Compares the collection against $items and returns the keys that are not present in the collection.
intersect(iterable $items) Compares the collection against $items and returns the values that exist in the collection.
intersectKeys(iterable $items) Compares the collection against $items and returns the keys that exist in the collection.
exists(callable $callback) Return true if one item return true to the callback.

Contributing

In order to be accepted, your contribution needs to pass a few controls:

To ease the validation process, you can use these 2 scripts:

Coding Standards and syntax

will check and fix the Coding Standards

Tests

will run the tests

Changelog

Changelog

LICENSE

License


All versions of collection with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
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 novactive/collection contains the following files

Loading the files please wait ....