Created
May 31, 2015 22:34
-
-
Save astorm/f245ce9c761c9a8053aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
//never do this for read, use __construct dependency injection | |
$r = new ReflectionObject($app); | |
$prop = $r->getProperty('_objectManager'); | |
$prop->setAccessible(true); | |
$manager = $prop->getValue($app); | |
//generates a factory, assuming `Pulsestorm\Helloworld\Test` exists | |
$factory = $manager->get('Pulsestorm\Helloworld\TestFactory'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment