├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 rkrx 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PHP Contracts 2 | ============= 3 | 4 | A curated list of mature interfaces to build components on. 5 | 6 | Good interfaces behave like a contract, a promise, a documentation. They don't have an opinion about the internals of a concrete implementation. 7 | So you can use interfaces while building huge applications to decouple different parts and hopefully gain a much better level of reusability, 8 | interchangeability and maintainability. 9 | 10 | **Rules:** 11 | 12 | 1. A project must only consist of interfaces that have the character of a contract. 13 | 2. The project must ship a good documentation. 14 | 3. The project could include one or more implementations. 15 | 4. The project's documentation must use english language. 16 | 5. The interface(s) must comply with [PSR-1](http://www.php-fig.org/psr/psr-1/). 17 | 6. The interface(s) should comply with [PSR-12](https://www.php-fig.org/psr/psr-12/). 18 | 7. There should exist implementations that show the practical benefit of the offered interface(s). 19 | 8. The project should be available through [Packagist](https://packagist.org/). 20 | 21 | 22 | ## Stable 23 | 24 | (Click on an item to get a list of available implementations) 25 | 26 | | Project | Latest | Implementations | 27 | |---------|-----------|-----------------| 28 | | [Logger Interface (PSR-03)](https://www.php-fig.org/psr/psr-3/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/log)](https://packagist.org/packages/psr/log) | [Compatible Packages](https://packagist.org/packages/psr/log) | 29 | | [Simple Cache (PSR-16)](https://www.php-fig.org/psr/psr-16/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/simple-cache)](https://packagist.org/packages/psr/simple-cache) | [Compatible Packages](https://packagist.org/packages/psr/simple-cache) | 30 | | [Caching Interface (PSR-06)](https://www.php-fig.org/psr/psr-6/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/cache)](https://packagist.org/packages/psr/cache) | [Compatible Packages](https://packagist.org/packages/psr/cache) | 31 | | [Container Interface (PSR-11)](https://www.php-fig.org/psr/psr-11/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/container)](https://packagist.org/packages/psr/container) | [Compatible Packages](https://packagist.org/packages/psr/container) | 32 | | [HTTP Message Interface (PSR-07)](https://www.php-fig.org/psr/psr-7/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/http-message)](https://packagist.org/packages/psr/http-message) | [Compatible Packages](https://packagist.org/packages/psr/http-message) | 33 | | [HTTP-Client (PSR-18)](https://www.php-fig.org/psr/psr-18/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/http-client)](https://packagist.org/packages/psr/http-client) | [Compatible Packages](https://packagist.org/packages/psr/http-client) | 34 | | [HTTP Server-Handler (PSR-15)](https://www.php-fig.org/psr/psr-15/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/http-server-handler)](https://packagist.org/packages/psr/http-server-handler) | [Compatible Packages](https://packagist.org/packages/psr/http-server-handler) | 35 | | [HTTP Factories (PSR-17)](https://www.php-fig.org/psr/psr-17/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/http-factory)](https://packagist.org/packages/psr/http-factory) | [Compatible Packages](https://packagist.org/packages/psr/http-factory) | 36 | | [Hypermedia Links (PSR-13)](https://www.php-fig.org/psr/psr-13/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/link)](https://packagist.org/packages/psr/link) | [Compatible Packages](https://packagist.org/packages/psr/link) | 37 | | [Event Dispatcher (PSR-14)](https://www.php-fig.org/psr/psr-14/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/event-dispatcher)](https://packagist.org/packages/psr/event-dispatcher) | [Compatible Packages](https://packagist.org/packages/psr/event-dispatcher) | 38 | | [Clock (PSR-20)](https://www.php-fig.org/psr/psr-20/) | [![Latest Stable](https://img.shields.io/packagist/v/psr/clock)](https://packagist.org/packages/psr/clock) | [Compatible Packages](https://packagist.org/packages/psr/clock) | 39 | 40 | ## Drafts 41 | 42 | | Project | Packagist | Status | 43 | |---------|-----------|--------| 44 | | [adammbalogh/key-value-store](https://github.com/adammbalogh/key-value-store) | [![Latest Stable](http://img.shields.io/packagist/v/adammbalogh/key-value-store.svg)](https://packagist.org/packages/adammbalogh/key-value-store) | Draft | 45 | | [rkr/php-ioc-contract](https://packagist.org/packages/rkr/php-ioc-contract) | [![Latest Stable](http://img.shields.io/packagist/v/rkr/php-di-ioc-adapter.svg)](https://packagist.org/packages/rkr/php-di-ioc-adapter) | Draft | 46 | 47 | 48 | ## Noteworthy projects 49 | 50 | * [illuminate/contracts](https://github.com/illuminate/contracts) – Subtree split of the Illuminate Contracts component (see laravel/framework) 51 | * [HttpKernelInterface](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpKernelInterface.php) – HttpKernelInterface handles a Request to convert it to a Response. 52 | * [FlySystem](http://flysystem.thephpleague.com) – Flysystem is a filesystem abstraction which allows you to easily swap out a local filesystem for a remote one. Reducing technical debt and chance of vendor lock-in. 53 | 54 | 55 | ## Wishlist 56 | 57 | * 3rd Party APIs (Amazon, Google etc) 58 | * Authentication 59 | * (More) Communication (Email, Sms, Notifications etc.) 60 | * (More) Date-, Time-, Interval-, Calendar-Manipulation 61 | * (More) Dependency-Injection-Container interfaces with more methods (make, call etc.) 62 | * E-Commerce (Payment, common order structures, common address structures etc.) 63 | * FileSystem-Abstraction 64 | * Filetype-Abstraction 65 | * Filtering 66 | * Image-Manipulation 67 | * Key-Value-Stores 68 | * ORM / Data-Handling / Data-Structures 69 | * Queues (like RabbitMQ / Gearman) 70 | * Search-Server-Interfaces (querying, Responses, Facettes etc) 71 | * Template-Engines 72 | * URL-Manipulation 73 | * Validation 74 | 75 | --------------------------------------------------------------------------------