PHPackages                             mangelsnc/specific-class-collection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mangelsnc/specific-class-collection

ActiveLibrary

mangelsnc/specific-class-collection
===================================

Abstract class to build Specific Type Collection classes

12.1kPHP

Since Oct 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mangelsnc/specific-class-collection)[ Packagist](https://packagist.org/packages/mangelsnc/specific-class-collection)[ RSS](/packages/mangelsnc-specific-class-collection/feed)WikiDiscussions dev Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/fcab958091824939fb5f9a21745435a661c3916c56deedd080784816195ef6d3/68747470733a2f2f7472617669732d63692e6f72672f6d616e67656c736e632f73706563696669632d636c6173732d636f6c6c656374696f6e2e7376673f6272616e63683d646576)](https://travis-ci.org/mangelsnc/specific-class-collection) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/f2615c8ea7cb7b6e7ecbe947ba7c1eeff9e111d0cfb05c2525d6cd15236880e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616e67656c736e632f73706563696669632d636c6173732d636f6c6c656374696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d646576)](https://scrutinizer-ci.com/g/mangelsnc/specific-class-collection/?branch=dev) [![Code Coverage](https://camo.githubusercontent.com/9749edbfacbdb21c5327b1ca862ded84bc1a9154d49eda8c82e4012d1cd1e1b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616e67656c736e632f73706563696669632d636c6173732d636f6c6c656374696f6e2f6261646765732f636f7665726167652e706e673f623d646576)](https://scrutinizer-ci.com/g/mangelsnc/specific-class-collection/?branch=dev)

SpecificClassCollection
=======================

[](#specificclasscollection)

Installation
------------

[](#installation)

Just execute:

```
composer require mangelsnc/specific-class-collection

```

Description
-----------

[](#description)

This abstract class allows you to create collections of a specific class.

Have you ever seen something like this in Java?

```
public String join (ArrayList collection) {
    String joinedString = '';

    for (String temp : collection) {
        joinedString.concat(temp);
    }

    return joinedString;
}
```

It's very useful to have a collection that ensures all the objects contained on it are of some specific class.

PHP lacks of something like that, and we are forced to make unelegant code like this:

```
