Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 5.65 KB

README.md

File metadata and controls

74 lines (57 loc) · 5.65 KB

PHP Contracts

A curated list of mature interfaces to build components on.

Good interfaces behave like a contract, a promise, a documentation. They don't have an opinion about the internals of a concrete implementation. So you can use interfaces while building huge applications to decouple different parts and hopefully gain a much better level of reusability, interchangeability and maintainability.

Rules:

  1. A project must only consist of interfaces that have the character of a contract.
  2. The project must ship a good documentation.
  3. The project could include one or more implementations.
  4. The project's documentation must use english language.
  5. The interface(s) must comply with PSR-1.
  6. The interface(s) should comply with PSR-12.
  7. There should exist implementations that show the practical benefit of the offered interface(s).
  8. The project should be available through Packagist.

Stable

(Click on an item to get a list of available implementations)

Project Latest Implementations
Logger Interface (PSR-03) Latest Stable Compatible Packages
Simple Cache (PSR-16) Latest Stable Compatible Packages
Caching Interface (PSR-06) Latest Stable Compatible Packages
Container Interface (PSR-11) Latest Stable Compatible Packages
HTTP Message Interface (PSR-07) Latest Stable Compatible Packages
HTTP-Client (PSR-18) Latest Stable Compatible Packages
HTTP Server-Handler (PSR-15) Latest Stable Compatible Packages
HTTP Factories (PSR-17) Latest Stable Compatible Packages
Hypermedia Links (PSR-13) Latest Stable Compatible Packages
Event Dispatcher (PSR-14) Latest Stable Compatible Packages
Clock (PSR-20) Latest Stable Compatible Packages

Drafts

Project Packagist Status
adammbalogh/key-value-store Latest Stable Draft
rkr/php-ioc-contract Latest Stable Draft

Noteworthy projects

  • illuminate/contracts – Subtree split of the Illuminate Contracts component (see laravel/framework)
  • HttpKernelInterface – HttpKernelInterface handles a Request to convert it to a Response.
  • FlySystem – 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.

Wishlist

  • 3rd Party APIs (Amazon, Google etc)
  • Authentication
  • (More) Communication (Email, Sms, Notifications etc.)
  • (More) Date-, Time-, Interval-, Calendar-Manipulation
  • (More) Dependency-Injection-Container interfaces with more methods (make, call etc.)
  • E-Commerce (Payment, common order structures, common address structures etc.)
  • FileSystem-Abstraction
  • Filetype-Abstraction
  • Filtering
  • Image-Manipulation
  • Key-Value-Stores
  • ORM / Data-Handling / Data-Structures
  • Queues (like RabbitMQ / Gearman)
  • Search-Server-Interfaces (querying, Responses, Facettes etc)
  • Template-Engines
  • URL-Manipulation
  • Validation