Added Service Locator pattern

This commit is contained in:
tafax
2014-02-17 16:41:21 +01:00
parent c232381f3b
commit 67c26edeb3
8 changed files with 279 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace DesignPatterns\ServiceLocator;
interface ServiceLocatorInterface
{
/**
* Checks if a service is registered.
*
* @param string $interface
*
* @return bool
*/
public function has($interface);
/**
* Gets the service registered for the interface.
*
* @param string $interface
*
* @return mixed
*/
public function get($interface);
}