Download the PHP package axonode/collections without Composer

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

Axonode Collections

Table of contents

  1. Description
  2. Requirements
  3. Installation
  4. Provided interfaces
  5. Usage
  6. Contributing
  7. License

Description

This library provides implementations for common data structures (Pair, List, Dictionary, Set) in PHP.

Requirements

Installation

  1. Add the package to your project using Composer:

Provided interfaces

For mockability, the library defines various interfaces which are implemented by concrete classes.

Usage

\Axonode\Collections\Object\Hashable

The Hashable interface represents an object, which can be uniquely identified by a hash. The hash is a string, which is used to compare objects for equality. If you do not want to customise how the hash is created, this package provides a trait (\Axonode\Collections\Object\GeneratesObjectHash), which implements the getHash method using the spl_object_hash function.

\Axonode\Collections\Pair<TKey, TValue>

The Pair class represents an immutable key-value pair.

To create a new instance use the constructor provide by the class:

Pairs are immutable, so you cannot change the key or value after the object has been created, but for convenience, the interface provides methods to create a new pair with a different key or value:

Collections

All collections are derived from the interface \Axonode\Collections\Contracts\ICollection<TKey, TValue>. The base ICollection interface extends


\Axonode\Collections\ArrayList<T>

The ArrayList<T> (implementing \Axonode\Collections\Contracts\IList<T>) class represents a list of items. The items are indexed by sequential integers. To maintain the incrementing sequence of keys in the list, after any operation which mutates the number or order of elements in the list, the keys are reindexed.

You can get a new instance of an ArrayList by calling its constructor:


\Axonode\Collections\Dictionary<TKey, TValue>

The Dictionary<TKey, TValue> (implementing \Axonode\Collections\Contracts\IDictionary<TKey, TValue>) class represents a collection of items, where each item is associated with a unique key. The keys usually holds a significant meaning. Unlike a traditional array, the keys may be of any type supported by PHP. To achieve this, a dictionary is a list of \Axonode\Collections\Contracts\IPair<TKey, TValue> implementations.

You can get a new instance of a Dictionary by calling its constructor:


\Axonode\Collections\Set<T>

The Set<T> (implementing \Axonode\Collections\Contracts\ISet<T>) class represents a collection of unique items. The items are indexed by sequential integers. To maintain the incrementing sequence of keys in the list, after any operation which mutates the number or order of elements in the list, the keys are reindexed.

You can get a new instance of an Set by calling its constructor:


Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

License

This project is licensed under the GPL v3 License - see the LICENSE file for details.


All versions of collections with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-spl Version *
ext-random 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 axonode/collections contains the following files

Loading the files please wait ....