本文整理匯總了PHP中Container::getRaw方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::getRaw方法的具體用法?PHP Container::getRaw怎麽用?PHP Container::getRaw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Container
的用法示例。
在下文中一共展示了Container::getRaw方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRaw
/**
* Get the raw object prior to resolution.
*
* @param string $binding The $binding key to get the raw value from.
*
* @return mixed Value of the $binding.
*/
public function getRaw($binding)
{
if (isset($this->bindings[$binding])) {
return $this->bindings[$binding];
} elseif (isset($this->parent)) {
return $this->parent->getRaw($binding);
}
return null;
}
示例2: getRaw
/**
* Get the raw data assigned to a key.
*
* @param string $key The key for which to get the stored item.
*
* @return mixed
*
* @since 1.0
*/
protected function getRaw($key)
{
$key = $this->resolveAlias($key);
if (isset($this->dataStore[$key])) {
return $this->dataStore[$key];
} elseif ($this->parent instanceof Container) {
return $this->parent->getRaw($key);
}
return null;
}
示例3: mergeInheritedDependencies
/**
* Add methods and args from inherited classes/interfaces
*
* @return void
*/
protected function mergeInheritedDependencies()
{
$reflection = new \ReflectionClass($this->class);
$inheritance = $reflection->getInterfaceNames();
$class = $reflection;
while ($parent = $class->getParentClass()) {
$inheritance[] = $parent->getName();
$class = $parent;
}
foreach ($inheritance as $interface) {
$interface = $this->container->getRaw($interface);
if ($interface instanceof static and $interface->inherit()) {
$this->addArgs($interface->getArgs());
$this->withMethods($interface->getMethods());
}
}
}