PlumCollection integrates Cocur\Collection into Plum. Plum is a data processing pipeline for PHP.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.appveyor.yml
.gitignore
.scrutinizer.yml
.styleci.yml
.travis.yml
LICENSE
Makefile
README.md
composer.json
phpunit.xml.dist

README.md

Plum

PlumCollection integrates Cocur\Collection into Plum. Plum is a data processing pipeline for PHP.

Latest Version Build Status Windows Build status Scrutinizer Code Quality Code Coverage StyleCI

Developed by Florian Eckerstorfer in Vienna, Europe.

Installation

You can install PlumCollection using Composer.

$ composer require plumphp/plum-collection

Usage

Please refer to the Plum documentation for more information about using Plum in general.

PlumCollection provides converts to convert items into elements of a collection.

ItemConverter

Plum\PlumCollection\ItemConverter converts the given item into an instance of Cocur\Collection\Item and adds it to the collection.

use Plum\PlumCollection\ItemConverter;
use Cocur\Collection\Collection;

$collection = new Collection();
$converter = new ItemConverter($collection);

$converter->convert('foobar'); // -> Cocur\Collection\Item
$collection->count(); // -> 1

ArrayItemConverter

Plum\PlumCollection\ArrayItemConverter converts the given item into an instance of Cocur\Collection\ArrayItem and adds it to the collection.

use Plum\PlumCollection\ArrayItemConverter;
use Cocur\Collection\Collection;

$collection = new Collection();
$converter = new ArrayItemConverter($collection);

$converter->convert(['foo' => 'bar']); // -> Cocur\Collection\ArrayItem
$collection->count(); // -> 1

Change Log

Version 0.1.1 (17 May 2015)

  • Update dependency to Cocur\Collection

Version 0.1 (28 April 2015)

  • Initial release

License

The MIT license applies to plumphp/plum-collection. For the full copyright and license information, please view the LICENSE file distributed with this source code.