Created
December 21, 2016 08:43
-
-
Save fritz-gerneth/47bc5a2a84a4c3099720222617d475fa 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 ProcessorFactory | |
{ | |
public function __invoke(ContainerInterface $container) | |
{ | |
$processor = new Processor( | |
$container->get(Schema::class) | |
); | |
$processor->getExecutionContext()->getContainer()->set( | |
ContainerInterface::class, | |
$container | |
); | |
return $processor; | |
} | |
} |
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 | |
trait ServiceLocatorAwareTrait | |
{ | |
/** | |
* @param ResolveInfo $info | |
* @return ContainerInterface | |
*/ | |
protected function getServiceLocator(ResolveInfo $info) | |
{ | |
return $info->getContainer()->get(ContainerInterface::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment