2017 © Pedro Peláez
 

library collections

Generic-like collections for php, inspired by OOP languages structures

image

sharkzt/collections

Generic-like collections for php, inspired by OOP languages structures

  • Monday, October 16, 2017
  • by Sharkzt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Collections

Collections for php, inspired by OOP generic languages structures, (*1)

Build Status Coverage Status, (*2)

Installation

The recommended way to install bundle is through Composer:, (*3)

$ composer require sharkzt/collections

Usage Examples

ArrayList

``` php //rough example of ArrayListcreation, usually goes in constructor; see examples classes $user = new User(); $user->articles = new ArrayList(Article::class);, (*4)


ArrayList will accept only Article instances as arguments. ``` php //addAll argument can be any iterable form, like ArrayList $user->articles->addAll([ (new Article()) ->setTitle('foo') ->setContent('bar'), (new Article()) ->setTitle('baz') ->setContent('qux'), ]); $singleArticle = (new Article()) ->setTitle('foo') ->setContent('bar'); $user->articles->add($singleArticle);

Can add iterable articles, or single invoking add method., (*5)

``` php if ($user->articles->contains($singleArticle)) { $user->articles->remove($singleArticle);
}, (*6)

foreach ($user->articles as $article) { if ($article->getContent() === 'qux') { $article->setTitle('foo'); break; } } ```, (*7)

Possible usage examples., (*8)

License

Collections classes are released under the MIT License. See the bundled LICENSE file for details., (*9)

The Versions

16/10 2017

dev-master

9999999-dev https://github.com/Sharkzt/Collections

Generic-like collections for php, inspired by OOP languages structures

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

The Development Requires

by Alexander Pysarchuk

php collections

15/10 2017

0.1.0

0.1.0.0 https://github.com/Sharkzt/Collections

Generic-like collections for php, inspired by OOP languages structures

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

The Development Requires

by Alexander Pysarchuk

php collections