Home

Awesome

Repository

PHP7 Tested Build Status Scrutinizer Code Quality SensioLabsInsight Latest Stable Version Total Downloads License Donate

Generic implementation and definition of a Repository and its in-memory implementation.

Installation

Use Composer to install the package:

$ composer require nilportugues/repository

InMemory Implementation

A custom repository can be easily created by extending the InMemoryRepository class provided.

use NilPortugues\Foundation\Infrastructure\Model\Repository\InMemory\InMemoryRepository

class MyInMemoryRepository extends InMemoryRepository
{
    //... your custom implementation.
}

Implementation can be seen here.

The base InMemoryRepository implements the following interfaces:

InMemoryRepository Example

An example with a complete implementation can be found in the /example directory.

In the example:

Foundation Classes

Interaction with the repository requires the usage of the following classes or classes implementing interfaces.

Interfaces


Quality

To run the PHPUnit tests at the command line, go to the tests directory and issue phpunit.

This library attempts to comply with PSR-1, PSR-2, PSR-4.

If you notice compliance oversights, please send a patch via Pull Request.

Contribute

Contributions to the package are always welcome!

Support

Get in touch with me using one of the following means:

Authors

License

The code base is licensed under the MIT license.