Skip to content

Instantly share code, notes, and snippets.

@aurimasniekis
Created March 31, 2015 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurimasniekis/abe0145ebbc41030422a to your computer and use it in GitHub Desktop.
Save aurimasniekis/abe0145ebbc41030422a to your computer and use it in GitHub Desktop.
<?php
class CachedContainer extends Container
{
protected $container;
public function __construct()
{
$this->container['foo'] = new Bar();
$this->container['bar'] = new Foo();
}
}
<?php
class SymfonyContainer
{
public function getContainer()
{
$container = new Container();
$container->add('foo', $this->get('bar'));
$container->add('bar', $this->get('foo'));
return $container;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment