Skip to content

Commit ec5543b

Browse files
committed
Merge pull request #9 from container-interop/ContainerException
Base ContainerException
2 parents 1b2142e + 549b8cf commit ec5543b

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/Interop/Container/ContainerInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace Interop\Container;
77

8+
use Interop\Container\Exception\ContainerException;
89
use Interop\Container\Exception\NotFoundException;
910

1011
/**
@@ -17,7 +18,9 @@ interface ContainerInterface
1718
*
1819
* @param string $id Identifier of the entry to look for.
1920
*
20-
* @throws NotFoundException No entry was found for this identifier.
21+
* @throws NotFoundException No entry was found for this identifier.
22+
* @throws ContainerException Error while retrieving the entry.
23+
*
2124
* @return mixed Entry.
2225
*/
2326
public function get($id);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4+
*/
5+
6+
namespace Interop\Container\Exception;
7+
8+
/**
9+
* Base interface representing a generic exception in a container.
10+
*/
11+
interface ContainerException
12+
{
13+
}

src/Interop/Container/Exception/NotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
/**
99
* No entry was found in the container.
1010
*/
11-
interface NotFoundException
11+
interface NotFoundException extends ContainerException
1212
{
1313
}

0 commit comments

Comments
 (0)