Created
March 31, 2015 12:41
-
-
Save aurimasniekis/abe0145ebbc41030422a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CachedContainer extends Container | |
{ | |
protected $container; | |
public function __construct() | |
{ | |
$this->container['foo'] = new Bar(); | |
$this->container['bar'] = new Foo(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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