Download the PHP package temkaa/collections without Composer

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

Simple Collections

This project offers a collection that provide convenient methods to manipulate your data.

Installation:

Quickstart

Functionality

addElement(mixed $value, mixed $key = null): self

Adds a new element to collection.

chunk(int $size): list<CollectionInterface<int|string, mixed>>

Chunks elements in collection by given size.

count(): int

Returns count of elements in Collection.

each(callable $callback): CollectionInterface

Executes provided callback on each collection element. If false is returned from callback, iteration stops.

filter(FilterInterface $filter): CollectionInterface

Filters the collection with provided callback.

firstElement(): mixed

Returns first element from collection, null if collection is empty.

firstKey(): mixed

Returns first key from collection, null if collection is empty.

hasElement(mixed $value): bool

Returns true if element is found, false otherwise.

hasKey(mixed $key): bool

Returns true if key is found, false otherwise.

empty(): bool

Returns true if collection is empty, false otherwise.

lastElement(): mixed

Returns last element of collection, null if collection is empty.

lastKey(): mixed

Returns last key of collection, null if collection is empty.

map(callable $callback): Collection

Creates new collection from provided callback.

merge(CollectionInterface $collection, bool $recursive = false): CollectionInterface

Merges two collections with each other.

removeElement(mixed $value): self

Removes provided element from collection or silently does nothing if element does not exist.

removeKey(mixed $key): self

Removes provided key from collection or silently does nothing if key does not exist.

slice(int $offset, ?int $length = null): CollectionInterface

Slices collection from given offset with provided length. If length is not defined - gets all elements from given offset.

toArray(): array

Returns collection elements.

sort(Sort $sort): CollectionInterface

Sorts collection by provided directions by path or just values if array is an array of scalars.

unique(array|string|null $path = null): CollectionInterface

Returns unique elements by provided path or just unique array by values.


All versions of collections with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 temkaa/collections contains the following files

Loading the files please wait ....