Download the PHP package maike/iterable without Composer
On this page you can find all versions of the php package maike/iterable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download maike/iterable
More information about maike/iterable
Files in maike/iterable
Download maike/iterable
More information about maike/iterable
Files in maike/iterable
Vendor maike
Package iterable
Short Description An abstract class that gives you the power of making your class iterable
License MIT
Package iterable
Short Description An abstract class that gives you the power of making your class iterable
License MIT
Please rate this library. Is it a good library?
Informations about the package iterable
Iterable\Iterator
In other languages, like Java, you can use Collections that allows only one type. In TypeScript, for example we can do the following:
Unfortunatelly, PHP doesn't have this kind of thing, that's why I created this abstract class
Installing
This package is installed via composer:
Usage
In order to achieve a Collection that allows only one type in PHP, we have to create a class. In the following example, I'm creating a Collection Class extending the Iterable\Iterator
abstract class
Creating a Collection Class
With the above code we achieved two things:
- We have a collection that only allows
DateTime
Objects. - We can iterate over our Collection as we do in an array. See the following example:
Contributing
Run build
Run tests
All versions of iterable with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
The package maike/iterable contains the following files
Loading the files please wait ....