https://github.com/mparulski/collection-type
The library Collection/Map and subtypes with checking the types for PHP
https://github.com/mparulski/collection-type
php php-library php5
Last synced: about 1 year ago
JSON representation
The library Collection/Map and subtypes with checking the types for PHP
- Host: GitHub
- URL: https://github.com/mparulski/collection-type
- Owner: mparulski
- License: mit
- Created: 2015-03-25T21:14:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-24T18:45:53.000Z (about 11 years ago)
- Last Synced: 2025-04-09T20:44:22.543Z (over 1 year ago)
- Topics: php, php-library, php5
- Language: PHP
- Size: 508 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CollectionType
================
[](https://packagist.org/packages/mparulski/collection-type)
[](https://packagist.org/packages/mparulski/collection-type)
[](https://packagist.org/packages/mparulski/collection-type)
CollectionType is a library that provides Collection and Map with their subtypes which are checking types of data set for PHP.
## Requirements
---------------
* PHP 5.5.0 or higher
## Installation
---------------
CollectionType officially supports only installation through Composer. For Composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).
Install the module:
```sh
$ php composer.phar require mparulski/collection-type:0.*
```
## Example:
-----------
```php
use CollectionType\Collection\CollectionSet\HashSet;
use CollectionType\TypeValidator\ObjectTypeValidator;
$set = new HashSet(new IntegerTypeValidator());
$set->add(1);
$set->add(5);
// throw exception
$set->add(7.2);
```
## Documentation
----------------
Documentation is available in the [/docs](/docs) folder.
# LICENSE
Copyright (c) 2015 Michał Parulski http://opensource.org/licenses/MIT
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
and is licensed under the MIT license.