public function setUp() { $container = new phpbb_mock_container_builder(); $container->set('foo', new StdClass()); $container->set('bar', new StdClass()); $this->service_collection = new \phpbb\di\service_collection($container); $this->service_collection->add('foo'); $this->service_collection->add('bar'); parent::setUp(); }
/** * {@inheritdoc} */ public function offsetGet($index) { if (!$this->is_ordered) { $this->sort_services(); } return parent::offsetGet($index); }
/** * Sets the interval for all text_reparser cron tasks * * @param int $interval Interval in seconds, 0 to disable the cron task */ public function schedule_all($interval) { // This way we don't construct every registered reparser $reparser_array = array_keys($this->reparsers->getArrayCopy()); foreach ($reparser_array as $reparser) { $this->schedule($reparser, $interval); } }
/** * {@inheritdoc} */ public function current() { return $this->collection->offsetGet($this->key()); }