for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* YAWIK
*
* @filesource
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
* @license MIT
* @author [email protected]
*/
namespace Core\Factory;
use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Core\Options\ModuleOptions;
* Class ModuleOptionsFactory
* @package Core\Factory
class ModuleOptionsFactory implements FactoryInterface
{
* Create an object
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
* @return object
* @throws ServiceNotFoundException if unable to resolve the service.
* @throws ServiceNotCreatedException if an exception is raised when
* creating a service.
* @throws ContainerException if any other error occurs
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
$config = $container->get('Config');
return new ModuleOptions(isset($config['core_options']) ? $config['core_options'] : array());
}
* {@inheritDoc}
* @param ServiceLocatorInterface $serviceLocator
* @return ModuleOptions
public function createService(ServiceLocatorInterface $serviceLocator)
return $this($serviceLocator, ModuleOptions::class);