Download the PHP package dcsg/php-immutable-collections without Composer

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

Minimalist and Typed Immutable Collections for PHP

Minimum PHP Version Latest Stable Version License Build Status StyleCI SymfonyInsight Quality Gate Status Coverage Vulnerabilities Bugs Security Rating Total Downloads

A library that provides a set of minimalist, typed and piped Immutable Collections for PHP.

Requirements

PHP > 7.2

Installation

What Problems does this solve?

The lack of Generics in PHP does not allow to have typed collections in PHP.

This Library provides two abstract Immutable Collections:

Why Typed Immutable Collections

Typed Collections

Since PHP does not have Generics like Java has, it's not possible to have native typed collections. The Collections available in this Library are the foundation for you to create your own Typed Collections, you just need to extend them.

Typed Immutable Collections for DDD (Domain Driven Design)

DDD is all about having your code speaking the business language, the called Ubiquitous Language. Without Collections in PHP this is very hard to achieve using Arrays because you cannot add behavior to them. So what usually happens you add that behavior to your entity but it shouldn't be there. Another problem is the mutability of Arrays, VOs (Value Objects) MUST be always immutable and that's impossible with Arrays and you should always guarantee that the elements of that Array are all of the same type.

Collections vs Arrays

Other PHP Collections

There are other Collections for PHP out there, naming a few we have Doctrine Collections and Illuminate Collections. Those collections they solve different problems, are tailored to their specific use case, and their APIs are extensive and more important those Collections are Mutable. These combinations make it difficult to use those Collections for more simple use cases. That's why the Collections we provide here, have a very small API and don't even expose the Iterator API. This way you have the possibility to use them and extend it's behavior tailored for your needs.

Features

Basic usage

Creating a Typed List Collection
Creating a Typed Set Collection

Examples

We provide two simple examples for better understanding. One related to invoices and another one regarding Legs of a Cargo Ship.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE OF CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of php-immutable-collections with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^7.4|^8.0|^8.1
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 dcsg/php-immutable-collections contains the following files

Loading the files please wait ....