public function get($name) { if (!isset($this->indexed[$name])) { return null; } if (empty($this->indexed[$name])) { $this->indexed[$name] = $this->factory->target($name); } return $this->indexed[$name]; }
public function testGet() { $collection = new AssetCollection(['libs.js', 'all.css'], $this->factory); $this->assertNull($collection->get('nope.js')); $this->assertInstanceOf('MiniAsset\\AssetTarget', $collection->get('libs.js')); }