Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing strict types #2

Merged
merged 1 commit into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Bootstrap/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(ConfigLoaderInterface $configLoader, DiContainerFact
$this->diContainerFactory = $diContainerFactory;
}

public function __invoke()
public function __invoke() : ContainerInterface
{
$this->loadConfig();
$this->buildDiContainer();
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Di/Container/Factory/AbstractFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Di/Container/Factory/AuraDiFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Aura\Di\Container;
use Aura\Di\ContainerBuilder;
use Interop\Container\ContainerInterface;

/**
* @author Nikola Posa <[email protected]>
Expand All @@ -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;

Expand Down
5 changes: 3 additions & 2 deletions src/Di/Container/Factory/PimpleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Phoundation\Di\Container\Factory;

use Interop\Container\ContainerInterface;
use Xtreamwayz\Pimple\Container;

/**
Expand All @@ -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;

Expand Down
5 changes: 3 additions & 2 deletions src/Di/Container/Factory/ZendServiceManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@

namespace Phoundation\Di\Container\Factory;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\ServiceManager;

/**
* @author Nikola Posa <[email protected]>
*/
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 */

Expand Down