55use Dice \Dice ;
66use Dice \DiceException ;
77use Lkrms \Concept \FluentInterface ;
8+ use Lkrms \Container \Contract \ContainerInterface ;
89use Lkrms \Container \Event \GlobalContainerSetEvent ;
910use Lkrms \Container \Exception \ContainerNotLocatedException ;
1011use Lkrms \Container \Exception \ContainerServiceNotFoundException ;
1112use Lkrms \Container \Exception \InvalidContainerBindingException ;
12- use Lkrms \Contract \IContainer ;
1313use Lkrms \Contract \IService ;
1414use Lkrms \Contract \IServiceShared ;
1515use Lkrms \Contract \IServiceSingleton ;
1616use Lkrms \Contract \ReceivesContainer ;
1717use Lkrms \Contract \ReceivesService ;
1818use Lkrms \Facade \DI ;
1919use Lkrms \Facade \Event ;
20- use Psr \Container \ContainerInterface ;
20+ use Psr \Container \ContainerInterface as PsrContainerInterface ;
2121use Closure ;
2222use ReflectionClass ;
2323
2626 *
2727 * A static interface to the global service container is provided by {@see DI}.
2828 */
29- class Container extends FluentInterface implements IContainer
29+ class Container extends FluentInterface implements ContainerInterface
3030{
31- private static ?IContainer $ GlobalContainer = null ;
31+ private static ?ContainerInterface $ GlobalContainer = null ;
3232
3333 private Dice $ Dice ;
3434
@@ -76,7 +76,7 @@ private function bindContainer(): void
7676
7777 // Bind any interfaces that extend PSR-11's ContainerInterface
7878 foreach ($ class ->getInterfaces () as $ name => $ interface ) {
79- if ($ interface ->implementsInterface (ContainerInterface ::class)) {
79+ if ($ interface ->implementsInterface (PsrContainerInterface ::class)) {
8080 $ this ->instance ($ name , $ this );
8181 }
8282 }
@@ -118,7 +118,7 @@ final public static function hasGlobalContainer(): bool
118118 /**
119119 * @inheritDoc
120120 */
121- final public static function getGlobalContainer (): IContainer
121+ final public static function getGlobalContainer (): ContainerInterface
122122 {
123123 if (self ::$ GlobalContainer !== null ) {
124124 return self ::$ GlobalContainer ;
@@ -130,7 +130,7 @@ final public static function getGlobalContainer(): IContainer
130130 /**
131131 * Get the global container if it exists
132132 */
133- final public static function maybeGetGlobalContainer (): ?IContainer
133+ final public static function maybeGetGlobalContainer (): ?ContainerInterface
134134 {
135135 return self ::$ GlobalContainer ;
136136 }
@@ -141,7 +141,7 @@ final public static function maybeGetGlobalContainer(): ?IContainer
141141 * @throws ContainerNotLocatedException if the global container does not
142142 * exist.
143143 */
144- final public static function requireGlobalContainer (): IContainer
144+ final public static function requireGlobalContainer (): ContainerInterface
145145 {
146146 if (self ::$ GlobalContainer === null ) {
147147 throw new ContainerNotLocatedException ();
@@ -153,7 +153,7 @@ final public static function requireGlobalContainer(): IContainer
153153 /**
154154 * @inheritDoc
155155 */
156- final public static function setGlobalContainer (?IContainer $ container ): ?IContainer
156+ final public static function setGlobalContainer (?ContainerInterface $ container ): ?ContainerInterface
157157 {
158158 Event::dispatch (new GlobalContainerSetEvent ($ container ));
159159
0 commit comments