ØÞ¨”U°óPdAàxÞ¨”Uÿÿÿÿÿÿÿÿ d<pBߨ”U ÿÿÿÿd+p[Þ¨”UÐpóÀe=ØÞ¨”U`óPeAðþᨔUÐPóÀeQŸß¨”UÀ`eAàxÞ¨”UÿÿÿÿÿÿÿÿÐe<à$⨔UÐÀòÿÿÿÿe_ú´¨”UÐÿÿÿÿÿÿÿÿe‰p[Þ¨”UÀòÈh=ØÞ¨”U°òPhAàxÞ¨”Uÿÿÿÿÿÿÿÿàh< Ñ⨔Uàÿÿÿÿhp[Þ¨”UÀ`òÐj=àxÞ¨”Uÿÿÿÿÿÿÿÿj< Fߨ”U@j. ÒᨔUÿÿÿÿj4pBߨ”U ÿÿÿÿj+p[Þ¨”U`ÐñØk=À—⨔UPkup[Þ¨”U ñàk=ØÞ¨”UñPkAàxÞ¨”Uÿÿÿÿÿÿÿÿ k<ñਔU `kuàxÞ¨”Uÿÿÿÿÿÿÿÿ0k< Ñ⨔Uà0ÿÿÿÿkp[Þ¨”U€ñèl=À—⨔UPluàxÞ¨”UÿÿÿÿÿÿÿÿPl< Ñ⨔UðPÿÿÿÿl€ËᨔUàÿÿÿÿn+pXÞ¨”Uÿÿÿÿ€ððo;MᨔUÿÿÿÿÿÿÿÿod°â¨”UÐ`ð€p]ýਔU€Pp¹ñÞ¨”U0ð`qtо⨔UàppBàxÞ¨”Uÿÿÿÿÿÿÿÿo<à$⨔UÐïÿÿÿÿo_ú´¨”Uÿÿÿÿÿÿÿÿp‰p[Þ¨”Up°ïøu=À—⨔UàPuuØÞ¨”U€ï`uA€mÞ¨”Uÿÿÿÿÿÿÿÿ°uà$⨔UÐ ïÿÿÿÿu_ú´¨”U°ÿÿÿÿÿÿÿÿu‰p[Þ¨”UÀïy=àxÞ¨”UÿÿÿÿÿÿÿÿÀy< Fߨ”UÀ€Ðy.À⨔UÀîàyRPþÞ¨”Uà°îðyÐJߨ”UðÿÿÿÿÐy4 Fߨ”UÐ@Ðy. ÒᨔUÿÿÿÿÐy4pBߨ”UРÿÿÿÿy+ B⨔U  î {p B⨔U  î0{p`LᨔUÿÿÿÿ0î {6À⨔U î @{R Èߨ”U {7@Îߨ”U àí {8§ß¨”U P{tо⨔U`{BàxÞ¨”Uÿÿÿÿÿÿÿÿ@ {<øà¨”U@ P{2àxÞ¨”UÿÿÿÿÿÿÿÿP {< Ñ⨔UP ÿÿÿÿ{O⨔Uíp }s°!ߨ”Up ÿÿÿÿ€ }pBߨ”U€ Àÿÿÿÿ}+ðþᨔUÀì ~Q Ï⨔U ÿÿÿÿ~À⨔Uì° X€R°ìߨ”U° €ìÀ € Fߨ”UÀ €À €.À⨔UPìÐ p€RÀžÞ¨”U@ìÐ à €ÐJߨ”Uà ÿÿÿÿÀ €4pBߨ”UÀ `ÿÿÿÿ€+À⨔Uðëð ˆR Ï⨔Uð ÿÿÿÿp[Þ¨”UÀÀë „=À—⨔UP„uàxÞ¨”Uÿÿÿÿÿÿÿÿ „< Ñ⨔Uà ÿÿÿÿ„p[Þ¨”U€P먅=À—⨔UP…uàxÞ¨”Uÿÿÿÿÿÿÿÿ0 …< Ñ⨔Uð0 ÿÿÿÿ…€ËᨔUà@ÿÿÿÿ‡+pXÞ¨”UÿÿÿÿÐê°ˆ;MᨔUÿÿÿÿÿÿÿÿˆd°â¨”Uаê` ‰]ýਔU` P‰¹ñÞ¨”U€ê`Štо⨔Uàp‰BàxÞ¨”Uÿÿÿÿÿÿÿÿp ˆ<à$⨔UÐàéÿÿÿÿˆ_ú´¨”Up ÿÿÿÿÿÿÿÿ‰‰p[Þ¨”U°ð鸒=àxÞ¨”Uÿÿÿÿÿÿÿÿ€ ’<pBߨ”U€ Àÿÿÿÿ’+p[Þ¨”U€ éÀ•=p[Þ¨”UéÈ•=ØÞ¨”U€éP•AàxÞ¨”Uÿÿÿÿÿÿÿÿ •<ñਔU P•up[Þ¨”U0éЕ=ØÞ¨”U éP•AàxÞ¨”Uÿÿÿÿÿÿÿÿ  •<ñਔU  `•up[Þ¨”UÐèØ•=ØÞ¨”UÀèP•AàxÞ¨”Uÿÿÿÿÿÿÿÿ° •<ñਔU° p•u€mÞ¨”UÿÿÿÿÿÿÿÿÀ • Ñ⨔UÀ ÿÿÿÿ•€ËᨔUÀÿÿÿÿ—+p[Þ¨”U€èà—=À—⨔UP—uàxÞ¨”Uÿÿÿÿÿÿÿÿà —<@ ਔUà ÿÿÿÿð —0kÞ¨”U@ÿÿÿÿÿÿÿÿ—*€“Þ¨”U€çÿÿÿÿð — Ï⨔U ð ÿÿÿÿ—€ËᨔU àÿÿÿÿ™+p[Þ¨”U°0çèš= The ID to resolve the when-needs-give case for. * @param string $paramClass The class of the parameter to solve the when-needs-give case for. * * @return BuilderInterface|string Either the builder for the when-needs-give replacement, or the input parameter * class if not found. */ public function whenNeedsGive($id, $paramClass) { return isset($this->whenNeedsGive[$id][$paramClass]) ? $this->whenNeedsGive[$id][$paramClass] : $paramClass; } /** * Sets an entry in the when->needs->give chain. * * @param string|class-string $whenClass The "when" part of the chain, a class name or id. * @param string|class-string $needsClass The "needs" part of the chain, a class name or id. * @param BuilderInterface $builder The Builder instance that should be returned when a class needs the * specified id. * * @return void This method does not return any value. */ public function setWhenNeedsGive($whenClass, $needsClass, BuilderInterface $builder) { $this->whenNeedsGive[$whenClass][$needsClass] = $builder; } /** * Resolves an ide to an implementation with the input arguments. * * @param string|class-string|mixed $id The id, class name or built value to resolve. * @param string[]|null $afterBuildMethods A list of methods that should run on the built * instance. * @param mixed ...$buildArgs A set of build arguments that will be passed to * the implementation constructor. * * @return BuilderInterface|ReinitializableBuilderInterface|mixed The builder, set up to use the specified set of * build arguments. * @throws NotFoundException If the id is a string that does not resolve to an existing, concrete, class. */ public function resolveWithArgs($id, array $afterBuildMethods = null, ...$buildArgs) { if (!is_string($id)) { return $id; } if (empty($afterBuildMethods) && empty($buildArgs)) { return $this->resolve($id); } return $this->cloneBuilder($id, $afterBuildMethods, ...$buildArgs)->build(); } /** * Resolves an id or input value to a value or object instance. * * @template T * * @param string|class-string|mixed $id Either the id of a bound implementation, a class name or an * object to resolve. * @param string[]|null $buildLine The build line to append the resolution leafs to, or `null` to * use the current one. * * @return T|mixed The resolved value or instance. * @phpstan-return ($id is class-string ? T : mixed) * * @throws NotFoundException If the id is a string that is not bound and is not an existing, concrete, class. */ public function resolve($id, array $buildLine = null) { if ($buildLine !== null) { $this->buildLine = $buildLine; } if (!is_string($id)) { return $id; } if (!isset($this->bindings[$id])) { return $this->resolveUnbound($id); } if ($this->bindings[$id] instanceof BuilderInterface) { $built = $this->resolveBound($id); } else { $built = $this->bindings[$id]; } return $built; } /** * Builds, with auto-wiring, an instance of a not bound class. * * @param string|class-string $id The class name to build an instance of. * * @return object The built class instance. * * @throws NotFoundException If the id cannot be resolved to an existing, concrete class. */ private function resolveUnbound($id) { $built = (new ClassBuilder($id, $this, $id))->build(); if ($this->resolveUnboundAsSingletons) { $this->singletons[$id] = true; $this->bindings[$id] = $built; } return $built; } /** * Resolves a bound implementation to a value or object. * * @param string|class-string $id The id to resolve the implementation for. * * @return mixed The resolved instance. */ private function resolveBound($id) { // @phpstan-ignore-next-line $built = $this->bindings[$id]->build(); if (isset($this->singletons[$id])) { $this->bindings[$id] = $built; } return $built; } /** * Clones the builder assigned to an id and re-initializes it. * The clone operation leverages the already resolved dependencies of a builder to create an up-to-date instance. * * @param string|class-string $id The id to clone the builder of. * @param string[]|null $afterBuildMethods A set of methods to run on the built instance. * @param mixed ...$buildArgs An optional set of arguments that will be passed to the instance * constructor. * * @return BuilderInterface A new instance of the builder currently related to the id. * @throws NotFoundException If trying to clone the builder for a non existing id or an id that does not map to a * concrete class name. */ private function cloneBuilder($id, array $afterBuildMethods = null, ...$buildArgs) { if (isset($this->bindings[$id]) && $this->bindings[$id] instanceof BuilderInterface) { $builder = clone $this->bindings[$id]; if ($builder instanceof ReinitializableBuilderInterface) { $builder->reinit($afterBuildMethods, ...$buildArgs); } } else { $builder = new ClassBuilder($id, $this, $id, $afterBuildMethods, ...$buildArgs); } return $builder; } /** * Adds an entry to the build line. * * @param string $type The type of parameter the Resolver is currently attempting to resolve. * @param string $parameterName The name of the parameter in the method signature, if any. * * @return void This method does not return any value. */ public function addToBuildLine($type, $parameterName) { $this->buildLine[] = trim("{$type} \${$parameterName}"); } /** * Returns the current build line. * * The build line will return a straight path from the current resolution root to the leaf * currently being resolved. Used for error logging and formatting. * * @return string[] A set of consecutive items the resolver is currently trying to build. */ public function getBuildLine() { return $this->buildLine; } /** * Removes the last element from the build line, if any. * * @return void The method does not return any value. */ public function buildLinePop() { array_pop($this->buildLine); } }