Automattic\WooCommerce\Vendor\League\Container
ReflectionContainer::get()
{@inheritdoc}
Метод класса: ReflectionContainer{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$ReflectionContainer = new ReflectionContainer(); $ReflectionContainer->get( $id, $args );
- $id (обязательный)
- -
- $args(массив)
- -
По умолчанию: []
Код ReflectionContainer::get() ReflectionContainer::get WC 7.5.1
public function get($id, array $args = []) { if ($this->cacheResolutions === true && array_key_exists($id, $this->cache)) { return $this->cache[$id]; } if (! $this->has($id)) { throw new NotFoundException( sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $id) ); } $reflector = new ReflectionClass($id); $construct = $reflector->getConstructor(); $resolution = $construct === null ? new $id : $resolution = $reflector->newInstanceArgs($this->reflectArguments($construct, $args)) ; if ($this->cacheResolutions === true) { $this->cache[$id] = $resolution; } return $resolution; }