2012-10-21 16:09:43 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
* @copyright (c) 2011 phpBB Group
|
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
if (!defined('IN_PHPBB'))
|
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2012-11-10 16:38:19 +01:00
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
2012-10-22 11:17:49 -04:00
|
|
|
|
2012-10-21 16:09:43 -04:00
|
|
|
/**
|
2012-11-10 16:38:19 +01:00
|
|
|
* Collection of services to be configured at container compile time.
|
2012-10-21 16:09:43 -04:00
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
*/
|
2012-11-10 16:38:19 +01:00
|
|
|
class phpbb_di_service_collection extends ArrayObject
|
2012-10-21 16:09:43 -04:00
|
|
|
{
|
|
|
|
/**
|
2012-10-22 11:17:49 -04:00
|
|
|
* Constructor
|
2012-10-21 16:09:43 -04:00
|
|
|
*
|
2012-11-10 16:38:19 +01:00
|
|
|
* @param ContainerInterface $container Container object
|
2012-10-21 16:09:43 -04:00
|
|
|
*/
|
2012-11-10 16:38:19 +01:00
|
|
|
public function __construct(ContainerInterface $container)
|
2012-10-21 16:09:43 -04:00
|
|
|
{
|
2012-10-22 11:17:49 -04:00
|
|
|
$this->container = $container;
|
2012-10-21 16:09:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-11-10 16:38:19 +01:00
|
|
|
* Add a service to the collection
|
2012-10-21 16:09:43 -04:00
|
|
|
*
|
2012-11-10 16:38:19 +01:00
|
|
|
* @param string $name The service name
|
2012-10-22 11:17:49 -04:00
|
|
|
* @return null
|
2012-10-21 16:09:43 -04:00
|
|
|
*/
|
2012-10-22 11:17:49 -04:00
|
|
|
public function add($name)
|
2012-10-21 16:09:43 -04:00
|
|
|
{
|
2012-10-22 11:17:49 -04:00
|
|
|
$task = $this->container->get($name);
|
2012-12-07 21:23:20 -06:00
|
|
|
|
2012-10-22 11:17:49 -04:00
|
|
|
$this->offsetSet($name, $task);
|
2012-10-21 16:09:43 -04:00
|
|
|
}
|
|
|
|
}
|