diff --git a/src/Bootstrap/Bootstrap.php b/src/Bootstrap/Bootstrap.php index b2627ea..94194c9 100644 --- a/src/Bootstrap/Bootstrap.php +++ b/src/Bootstrap/Bootstrap.php @@ -49,7 +49,7 @@ public function __construct(ConfigLoaderInterface $configLoader, DiContainerFact $this->diContainerFactory = $diContainerFactory; } - public function __invoke() + public function __invoke() : ContainerInterface { $this->loadConfig(); $this->buildDiContainer(); diff --git a/src/Config/Config.php b/src/Config/Config.php index 3e8329a..cb08ff8 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -19,7 +19,7 @@ */ class Config extends ArrayObject { - public static function fromArray(array $config) + public static function fromArray(array $config) : Config { return new self($config); } diff --git a/src/Di/Container/Factory/AbstractFactory.php b/src/Di/Container/Factory/AbstractFactory.php index 38ea914..a297027 100644 --- a/src/Di/Container/Factory/AbstractFactory.php +++ b/src/Di/Container/Factory/AbstractFactory.php @@ -49,11 +49,11 @@ public function __invoke(Config $config) : ContainerInterface return $container; } - abstract protected function createContainer(); + abstract protected function createContainer() : ContainerInterface; - abstract protected function configure($container); + abstract protected function configure(ContainerInterface $container); - final protected function getConfig() + final protected function getConfig() : Config { return $this->config; } diff --git a/src/Di/Container/Factory/AuraDiFactory.php b/src/Di/Container/Factory/AuraDiFactory.php index 5b2a86f..acd1566 100644 --- a/src/Di/Container/Factory/AuraDiFactory.php +++ b/src/Di/Container/Factory/AuraDiFactory.php @@ -14,6 +14,7 @@ use Aura\Di\Container; use Aura\Di\ContainerBuilder; +use Interop\Container\ContainerInterface; /** * @author Nikola Posa @@ -25,12 +26,12 @@ final class AuraDiFactory extends AbstractFactory */ protected $container; - protected function createContainer() + protected function createContainer() : ContainerInterface { return (new ContainerBuilder())->newInstance(); } - protected function configure($container) + protected function configure(ContainerInterface $container) { $this->container = $container; diff --git a/src/Di/Container/Factory/PimpleFactory.php b/src/Di/Container/Factory/PimpleFactory.php index 630310e..27a2a57 100644 --- a/src/Di/Container/Factory/PimpleFactory.php +++ b/src/Di/Container/Factory/PimpleFactory.php @@ -12,6 +12,7 @@ namespace Phoundation\Di\Container\Factory; +use Interop\Container\ContainerInterface; use Xtreamwayz\Pimple\Container; /** @@ -24,12 +25,12 @@ final class PimpleFactory extends AbstractFactory */ private $container; - protected function createContainer() + protected function createContainer() : ContainerInterface { return new Container(); } - protected function configure($container) + protected function configure(ContainerInterface $container) { $this->container = $container; diff --git a/src/Di/Container/Factory/ZendServiceManagerFactory.php b/src/Di/Container/Factory/ZendServiceManagerFactory.php index 66de10d..46420f4 100644 --- a/src/Di/Container/Factory/ZendServiceManagerFactory.php +++ b/src/Di/Container/Factory/ZendServiceManagerFactory.php @@ -12,6 +12,7 @@ namespace Phoundation\Di\Container\Factory; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\ServiceManager; /** @@ -19,12 +20,12 @@ */ final class ZendServiceManagerFactory extends AbstractFactory { - protected function createContainer() + protected function createContainer() : ContainerInterface { return new ServiceManager(); } - protected function configure($container) + protected function configure(ContainerInterface $container) { /* @var $container ServiceManager */