Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (30 sloc) 1002 Bytes
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_ServiceManager
*/
namespace ZendTest\ServiceManager\TestAsset;
use Zend\ServiceManager\DelegatorFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* Mock factory that logs delegated service instances and returns itself instead of the original service
*/
class MockSelfReturningDelegatorFactory implements DelegatorFactoryInterface
{
/**
* @var mixed[]
*/
public $instances = array();
/**
* {@inheritDoc}
*/
public function createDelegatorWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName, $callback)
{
$this->instances[] = call_user_func($callback);
return $this;
}
}
Jump to Line
Something went wrong with that request. Please try again.