WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Vendor\League\Container

ReflectionContainer::get() public WC 1.0

{@inheritdoc}

{} It's a method of the class: ReflectionContainer{}

No Hooks.

Return

null. Nothing.

Usage

$ReflectionContainer = new ReflectionContainer();
$ReflectionContainer->get( $id, $args );
$id (required)
-
$args(array)
-
Default: []

Code of ReflectionContainer::get() WC 5.7.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;
}