Last active
December 12, 2015 05:38
-
-
Save Djuki/4722817 to your computer and use it in GitHub Desktop.
DI Example
http://mnapoli.github.com/PHP-DI/
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
use DI\Annotations\Inject; | |
class Foo { | |
/** | |
* @Inject | |
* @var Bar | |
*/ | |
private $bar; | |
public function __construct() { | |
// The dependency is injected | |
return $this->bar->sayHello(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment