Created
June 14, 2016 10:14
-
-
Save polidog/22108eed742dd3082d7b9dc71942c6d1 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 | |
namespace AppBundle; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
use AppBundle\DependencyInjection\Compiler\YahooOAuthCompilerPass; | |
class AppBundle extends Bundle | |
{ | |
public function build(ContainerBuilder $container) | |
{ | |
parent::build($container); | |
$container->addCompilerPass(new YahooOAuthCompilerPass()); | |
} | |
} |
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 | |
namespace AppBundle\DependencyInjection\Compiler | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use AppBundle\OAuth\ResourceOwner\YahooJpResourceOwner; | |
/** | |
* OAuth2は基本使わないのでYahooように改造する | |
* Class YahooOAuthCompilerPass | |
*/ | |
class YahooOAuthCompilerPass implements CompilerPassInterface | |
{ | |
public function process(ContainerBuilder $container) | |
{ | |
$definition = $container->getDefinition('hwi_oauth.resource_owner.yahoo'); | |
$definition->setClass(YahooJpResourceOwner::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment