https://github.com/jeydotc/jeydotc-enumerable
An enumerable class that mimics the concepts of .Net's IEnumerable interface, but with slight adaptations for PHP.
https://github.com/jeydotc/jeydotc-enumerable
collection collections ienumerable immutable
Last synced: 3 months ago
JSON representation
An enumerable class that mimics the concepts of .Net's IEnumerable interface, but with slight adaptations for PHP.
- Host: GitHub
- URL: https://github.com/jeydotc/jeydotc-enumerable
- Owner: JeyDotC
- License: mit
- Created: 2019-03-15T15:48:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T22:34:37.000Z (about 6 years ago)
- Last Synced: 2025-02-24T21:09:43.150Z (4 months ago)
- Topics: collection, collections, ienumerable, immutable
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Enumerable class!
```php
$myEnumerable = Enumerable::from([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);$even = $myEnumerable->where(function(int $number){
return $number % 2 === 0;
});
// new Enumerable: 2, 4, 6, 8, 10$allPowered = $myEnumerable->select(function(int $number){
return $number * $number;
});
// new Enumerable: 1, 4, 9, 16, 25, 36, 48, 64, 81, 100$theAlpha = $myEnumerable->first();
// 1$theOmega = $myEnumerable->last();
// 10// And many more...
```## Installation
```bash
composer install jeydotc/jeydotc-enumerable
```