You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
997 B
37 lines
997 B
<?php
|
|
/**
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
|
*/
|
|
|
|
namespace Interop\Container;
|
|
|
|
use Interop\Container\Exception\ContainerException;
|
|
use Interop\Container\Exception\NotFoundException;
|
|
|
|
/**
|
|
* Describes the interface of a container that exposes methods to read its entries.
|
|
*/
|
|
interface ContainerInterface
|
|
{
|
|
/**
|
|
* Finds an entry of the container by its identifier and returns it.
|
|
*
|
|
* @param string $id Identifier of the entry to look for.
|
|
*
|
|
* @throws NotFoundException No entry was found for this identifier.
|
|
* @throws ContainerException Error while retrieving the entry.
|
|
*
|
|
* @return mixed Entry.
|
|
*/
|
|
public function get($id);
|
|
|
|
/**
|
|
* Returns true if the container can return an entry for the given identifier.
|
|
* Returns false otherwise.
|
|
*
|
|
* @param string $id Identifier of the entry to look for.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function has($id);
|
|
}
|