Hypolite Petovan
b0ee9fdf2a
- Removing symfony/polyfill-apcu (v1.28.0) - Removing psr/simple-cache (1.0.1) - Updating psr/http-message (1.1 => 2.0) - Downgrading psr/container (2.0.2 => 1.1.2) - Updating slim/slim (4.12.0 => 4.13.0) - Installing symfony/polyfill-php80 (v1.29.0) - Installing symfony/var-exporter (v5.4.35) - Installing symfony/deprecation-contracts (v2.5.2) - Installing symfony/service-contracts (v2.5.2) - Installing symfony/polyfill-php73 (v1.29.0) - Installing symfony/cache-contracts (v2.5.2) - Updating symfony/cache (v3.4.47 => v4.4.48)
37 lines
1 KiB
PHP
37 lines
1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psr\Container;
|
|
|
|
/**
|
|
* 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 NotFoundExceptionInterface No entry was found for **this** identifier.
|
|
* @throws ContainerExceptionInterface Error while retrieving the entry.
|
|
*
|
|
* @return mixed Entry.
|
|
*/
|
|
public function get(string $id);
|
|
|
|
/**
|
|
* Returns true if the container can return an entry for the given identifier.
|
|
* Returns false otherwise.
|
|
*
|
|
* `has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
|
* It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
|
|
*
|
|
* @param string $id Identifier of the entry to look for.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function has(string $id);
|
|
}
|