2017 © Pedro Peláez
 

library collections

Generic class to make a collection of any object type.

image

aaronbullard/collections

Generic class to make a collection of any object type.

  • Thursday, June 16, 2016
  • by aaronbullard
  • Repository
  • 1 Watchers
  • 0 Stars
  • 147 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Collection

A base Collection class that when extended will ensure that all items added to the collection are of a single type. Type can be determined by a static property or inferred from the extended classes namespace., (*1)

Getting started

Clone repo., (*2)

Install dependencies

From within the cloned folder collections run:, (*3)

Composer dependencies, (*4)

composer install

Testing

composer test

Usage

<?php

use Aaronbullard\Collections\Collection;

class Car {
    public $model;

    public function pressHorn(){
        return "Honk!";
    }
}

class CarCollection extends Collection {}

$cars = new CarCollection;

$numOfCars = 10;
$count = 0;
while($count < $numOfCars){
    $cars[$count] = new Car();
    $count++;
}

count($cars); //10
$cars[3]->pressHorn(); //"Honk!"

The Versions

16/06 2016

dev-master

9999999-dev

Generic class to make a collection of any object type.

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar aaronbullard

16/06 2016

dev-develop

dev-develop

Generic class to make a collection of any object type.

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar aaronbullard