Automattic\WooCommerce\Vendor\League\Container

Container::add()publicWC 1.0

Add an item to the container.

Метод класса: Container{}

Хуков нет.

Возвращает

DefinitionInterface.

Использование

$Container = new Container();
$Container->add( $id, $concrete, $shared ) : DefinitionInterface;
$id(строка) (обязательный)
-
$concrete(разное)
-
По умолчанию: null
$shared(true|false)
-
По умолчанию: null

Код Container::add() WC 8.7.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);
}