本文整理汇总了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());
}
}
}