accolon/container

2.0.0 2021-07-22 00:23 UTC

This package is auto-updated.

Last update: 2024-12-22 08:18:57 UTC


README

Use get for objects and get for rest.

<?php

use Accolon\Container\Container;

require_once './vendor/autoload.php';

$container = new Container();

$stdClass = new stdClass();

$stdClass->name = "George";

$container->singletons("class", $stdClass);

$container->bind("class2", \stdClass::class);

$container->get('class')->name = "George2";

var_dump($container->get('class'));
var_dump($container->get('class2'));