* @license GNU General Public License, version 2 (GPL-2.0) * * For full copyright and license information, please see * the docs/CREDITS.txt file. * */ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ScopeInterface; class phpbb_mock_container_builder implements ContainerInterface { protected $services = array(); protected $parameters = array(); /** * Sets a service. * * @param string $id The service identifier * @param object $service The service instance * @param string $scope The scope of the service * * @api */ public function set($id, $service, $scope = self::SCOPE_CONTAINER) { $this->services[$id] = $service; } /** * Gets a service. * * @param string $id The service identifier * @param int $invalidBehavior The behavior when the service does not exist * * @return object The associated service * * @throws InvalidArgumentException if the service is not defined * @throws ServiceCircularReferenceException When a circular reference is detected * @throws ServiceNotFoundException When the service is not defined * * @see Reference * * @api */ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { if ($this->has($id)) { $service = $this->services[$id]; if (is_array($service) && is_callable($service[0])) { return call_user_func_array($service[0], $service[1]); } else { return $service; } } throw new Exception('Could not find service: ' . $id); } /** * Returns true if the given service is defined. * * @param string $id The service identifier * * @return Boolean true if the service is defined, false otherwise * * @api */ public function has($id) { return isset($this->services[$id]); } /** * Gets a parameter. * * @param string $name The parameter name * * @return mixed The parameter value * * @throws InvalidArgumentException if the parameter is not defined * * @api */ public function getParameter($name) { if ($this->hasParameter($name)) { return $this->parameters[$name]; } throw new Exception('Could not find parameter: ' . $name); } /** * Checks if a parameter exists. * * @param string $name The parameter name * * @return Boolean The presence of parameter in container * * @api */ public function hasParameter($name) { return isset($this->parameters[$name]); } /** * Sets a parameter. * * @param string $name The parameter name * @param mixed $value The parameter value * * @api */ public function setParameter($name, $value) { $this->parameters[$name] = $value; } /** * Enters the given scope * * @param string $name * * @api */ public function enterScope($name) { } /** * Leaves the current scope, and re-enters the parent scope * * @param string $name * * @api */ public function leaveScope($name) { } /** * Adds a scope to the container * * @param ScopeInterface $scope * * @api */ public function addScope(ScopeInterface $scope) { } /** * Whether this container has the given scope * * @param string $name * * @return Boolean * * @api */ public function hasScope($name) { } /** * Determines whether the given scope is currently active. * * It does however not check if the scope actually exists. * * @param string $name * * @return Boolean * * @api */ public function isScopeActive($name) { } public function isFrozen() { return false; } } ȮҨܐYD{th!G:]{]zJXqX+T}M*zơ2_0g;x,XVO6OB|?SnO~:6+/~DνqpBND(覄&{0:ğ3 7\0ڻFx<Ԑ( h <R{hLr?υa?֕6??ómpݠ??&o=.j' ?ŜBu=}"@@R"`|x?"'AdB5Hwr]օOeL1"X,*Hse"RJJ,R PA $( %A?}X@@S%F*x QY U᳂Cp=8DԕO?|TWOݓh<CpqPKErDC)J buԿg|xSAQQ?. $AB|d@DH" ]1ќ4A{cJ\+5] @@Jd@c@ûSLΊ)S)YUAUXAAbX JIebE)H)T # # q6FIjj8EmݗW ?Vpch;Ǘo/U_`lwPQIL[g?ǛS/55 ˻.= Lh⢏;i@;Orھ`E8uZc$§N1Ml0 k1ղ>y`$@w4SNcQ`~P2 0ـAT19IB$ ?&czgEYcc~a`pr֤i*,U'Dd:([Z3}o:z']Xtq뷣G>"|i`zqㅒJ(#Jl\Q[ i x%EŻϘ9PmM +ˑhATQxY}`eX;e) Ur\u}aG%?JF2n,бP_L`<+m\ uV2jpO_TW@A_byhXB? ٌfbM~8S'AtK0 I\NaC Dگjz}Iȓ~ٰS>8Q> 7#5@VA4w>`_up).@%$H 5T6$ /|}F:K4nvpbY*8A_Or{~Y +,nŁ֍-jPp? {bYm \gN}o=$D$dF*C@aU$jA[-b\5a6lE$egzp(Py;HO4Bgjs Df%@|\H\,b=,E*U@g874dR*1 1RP$Ē,Lb(BD$S*wi{r|!qPi}77W$&uc*Y~n71n&c< \?v:ׁbt- ۩D!u9aWj/N{wߛmڎ`"]m6AQ>DppmU rl8b@:O UW*F{`J6U+S!UFH0 <>iIȁg-̰b;[FWW. ]!F,I-k=swsat5Et-4E(Vj7Ѡ =J Ez;)A]Hpv|J6pBFbrӈAP H1aD$_!|C5<&33|e|1@Y'(y+d[0D_M+sl E47Z7+b H~̨B 2$ 0@@"*,`*,@ /|a=p=Q3\"OR;}[Gޱm]g^N;( {h4&.u