PHPackages                             jascha030/type-collections - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jascha030/type-collections

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jascha030/type-collections
==========================

1.0.0(3y ago)06[1 PRs](https://github.com/jascha030/type-collections/pulls)MITPHPPHP ~8.0||~8.1||~8.2CI passing

Since Dec 25Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/jascha030/type-collections)[ Packagist](https://packagist.org/packages/jascha030/type-collections)[ RSS](/packages/jascha030-type-collections/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Type collections
================

[](#type-collections)

A small set of interfaces and an abstract implementation, extending the [Collection class](https://laravel.com/docs/9.x/collections) from `illuminate/collections`, used to create collections with predefined content types.

Getting started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

- PHP `>=8.0.2`

Having the `phpstan/phpstan` composer package installed globally is not required, but useful.

### Installation

[](#installation)

```
composer require Jascha030/type-collections
```

Usage
-----

[](#usage)

You can create a "typed" collection class by extending `Jascha030\TypeCollection\TypeCollectionAbstract`, this will require you to implement the `getType` method.

```
