/** * {@inheritdoc} */ public function load() { $classes = $this->loadFromCache(); if ($classes === null) { $classes = $this->innerLoader->load(); $this->saveInCache($classes); } return $classes; }
public function testLoadServiceParameters() { $services = array('test' => array('class' => '\\ReflectionMethod', 'parameters' => array('@main', 'testLoadWithParameters')), 'main' => array('class' => '\\Packfire\\FuelBlade\\ServiceLoaderTest')); $container = new Container(); ServiceLoader::load($container, $services); $this->assertTrue(isset($container['test'])); $this->assertInstanceOf('\\ReflectionMethod', $container['test']); $this->assertEquals(array(), $container['test']->getParameters()); $this->assertEquals('testLoadWithParameters', $container['test']->getName()); }
<?php defined('SYSPATH') or die('No direct script access.'); ServiceLoader::registerAutoload();