Automattic\WooCommerce\Vendor\League\Container

Container::add()publicWC 1.0

Add an item to the container.

Method of the class: Container{}

No Hooks.

Return

DefinitionInterface.

Usage

$Container = new Container();
$Container->add( $id, $concrete, $shared ) : DefinitionInterface;
$id(string) (required)
-
$concrete(mixed)
-
Default: null
$shared(true|false)
-
Default: null

Container::add() code WC 7.1.0

public function add(string $id, $concrete = null, bool $shared = null) : DefinitionInterface
{
    $concrete = $concrete ?? $id;
    $shared = $shared ?? $this->defaultToShared;

    return $this->definitions->add($id, $concrete, $shared);
}