File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed
Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1616namespace FastForward \Config \Container ;
1717
1818use FastForward \Config \ConfigInterface ;
19- use FastForward \Config \Exception \ContainerNotFoundExceptionInterface ;
19+ use FastForward \Config \Exception \ContainerNotFoundException ;
2020use Psr \Container \ContainerInterface ;
2121
2222/**
@@ -63,13 +63,13 @@ public function has(string $id): bool
6363 *
6464 * If the ID matches the container itself or the config class, it SHALL return itself.
6565 * Otherwise, it SHALL retrieve the value from the configuration.
66- * If the key is not found, it MUST throw a ContainerNotFoundExceptionInterface .
66+ * If the key is not found, it MUST throw a ContainerNotFoundException .
6767 *
6868 * @param string $id identifier of the entry to retrieve
6969 *
7070 * @return mixed the value associated with the identifier
7171 *
72- * @throws ContainerNotFoundExceptionInterface if the identifier is not found
72+ * @throws ContainerNotFoundException if the identifier is not found
7373 */
7474 public function get (string $ id )
7575 {
@@ -81,7 +81,7 @@ public function get(string $id)
8181 return $ this ->config ->get ($ id );
8282 }
8383
84- throw ContainerNotFoundExceptionInterface ::forKey ($ id );
84+ throw ContainerNotFoundException ::forKey ($ id );
8585 }
8686
8787 /**
Original file line number Diff line number Diff line change 1818use Psr \Container \NotFoundExceptionInterface ;
1919
2020/**
21- * Class ContainerNotFoundExceptionInterface .
21+ * Class ContainerNotFoundException .
2222 *
2323 * Exception thrown when a configuration key is not found in the container.
2424 * This class MUST implement the PSR-11 NotFoundExceptionInterface.
2525 */
26- final class ContainerNotFoundExceptionInterface extends \Exception implements NotFoundExceptionInterface
26+ final class ContainerNotFoundException extends \Exception implements NotFoundExceptionInterface
2727{
2828 /**
2929 * Creates a new exception instance for a missing configuration key.
Original file line number Diff line number Diff line change 1818use FastForward \Config \ArrayConfig ;
1919use FastForward \Config \ConfigInterface ;
2020use FastForward \Config \Container \ConfigContainer ;
21- use FastForward \Config \Exception \ContainerNotFoundExceptionInterface ;
21+ use FastForward \Config \Exception \ContainerNotFoundException ;
2222use PHPUnit \Framework \Attributes \CoversClass ;
2323use PHPUnit \Framework \Attributes \Test ;
2424use PHPUnit \Framework \Attributes \UsesClass ;
2929 */
3030#[CoversClass(ConfigContainer::class)]
3131#[UsesClass(ArrayConfig::class)]
32- #[UsesClass(ContainerNotFoundExceptionInterface ::class)]
32+ #[UsesClass(ContainerNotFoundException ::class)]
3333final class ConfigContainerTest extends TestCase
3434{
3535 #[Test]
@@ -90,7 +90,7 @@ public function testGetReturnsConfigValueForKey(): void
9090 #[Test]
9191 public function testGetThrowsExceptionForUnknownKey (): void
9292 {
93- $ this ->expectException (ContainerNotFoundExceptionInterface ::class);
93+ $ this ->expectException (ContainerNotFoundException ::class);
9494
9595 $ config = new ArrayConfig ();
9696 $ container = new ConfigContainer ($ config );
Original file line number Diff line number Diff line change 1515
1616namespace FastForward \Config \Tests \Exception ;
1717
18- use FastForward \Config \Exception \ContainerNotFoundExceptionInterface ;
18+ use FastForward \Config \Exception \ContainerNotFoundException ;
1919use PHPUnit \Framework \Attributes \CoversClass ;
2020use PHPUnit \Framework \Attributes \Test ;
2121use PHPUnit \Framework \TestCase ;
2424/**
2525 * @internal
2626 */
27- #[CoversClass(ContainerNotFoundExceptionInterface ::class)]
28- final class ContainerNotFoundExceptionInterfaceTest extends TestCase
27+ #[CoversClass(ContainerNotFoundException ::class)]
28+ final class ContainerNotFoundExceptionTest extends TestCase
2929{
3030 #[Test]
3131 public function testForKeyReturnsExpectedMessage (): void
3232 {
3333 $ key = uniqid ('missing_ ' , true );
3434
35- $ exception = ContainerNotFoundExceptionInterface ::forKey ($ key );
35+ $ exception = ContainerNotFoundException ::forKey ($ key );
3636
37- self ::assertInstanceOf (ContainerNotFoundExceptionInterface ::class, $ exception );
37+ self ::assertInstanceOf (ContainerNotFoundException ::class, $ exception );
3838 self ::assertInstanceOf (NotFoundExceptionInterface::class, $ exception );
3939 self ::assertSame (\sprintf ('Config key "%s" not found. ' , $ key ), $ exception ->getMessage ());
4040 }
You can’t perform that action at this time.
0 commit comments