https://github.com/stscoundrel/collection
Typed collection-like arrays for PHP
https://github.com/stscoundrel/collection
collections composer-library php typedarrays
Last synced: 2 months ago
JSON representation
Typed collection-like arrays for PHP
- Host: GitHub
- URL: https://github.com/stscoundrel/collection
- Owner: stscoundrel
- License: mit
- Created: 2021-03-19T19:13:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T22:59:50.000Z (over 1 year ago)
- Last Synced: 2024-04-03T22:20:57.762Z (about 1 year ago)
- Topics: collections, composer-library, php, typedarrays
- Language: PHP
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Collection
Minmalistic typed arrays/collections for PHP.
There are many collection libraries for PHP, but none exactly like I wanted. Most collection libraries add quite a lot of extra functionality I'm not looking for.
What collection does:
- Simple & lightweight
- Array syntax
- Allow typehinting for array of objects### Motivation
Typehinting "array" in PHP is not really descriptive. Sometimes its preferable to use collection-like typed arrays. This library provides common parent to make creating these collections less boilerplatey.
### Install
`composer require silvanus/collection`
### Usage
Create your own collection class that extends abstract parent.
```php