From 158e6b97b7f18a6694cb8491952a151f8b23570b Mon Sep 17 00:00:00 2001 From: michalmarcinkowski Date: Thu, 28 May 2015 10:45:43 +0200 Subject: [PATCH] Remove dependency from Core component --- .../Bundle/UserBundle/OAuth/UserProvider.php | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/Sylius/Bundle/UserBundle/OAuth/UserProvider.php b/src/Sylius/Bundle/UserBundle/OAuth/UserProvider.php index ef21bcf2272..82c9b953745 100644 --- a/src/Sylius/Bundle/UserBundle/OAuth/UserProvider.php +++ b/src/Sylius/Bundle/UserBundle/OAuth/UserProvider.php @@ -11,16 +11,17 @@ namespace Sylius\Bundle\UserBundle\OAuth; +use Doctrine\Common\Persistence\ObjectManager; use HWI\Bundle\OAuthBundle\Connect\AccountConnectorInterface; use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface; use HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface; -use Sylius\Component\Core\Model\UserInterface as SyliusUserInterface; +use Sylius\Bundle\UserBundle\Provider\UsernameOrEmailProvider as BaseUserProvider; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Component\User\Canonicalizer\CanonicalizerInterface; +use Sylius\Component\User\Model\UserInterface as SyliusUserInterface; use Sylius\Component\User\Model\UserOAuthInterface; -use Sylius\Bundle\UserBundle\Provider\UsernameOrEmailProvider as BaseUserProvider; +use Sylius\Component\User\Repository\UserRepositoryInterface; use Symfony\Component\Security\Core\User\UserInterface; -use Sylius\Component\User\Canonicalizer\CanonicalizerInterface; -use Doctrine\Common\Persistence\ObjectManager; /** * Loading and ad-hoc creation of a user by an OAuth sign-in provider account. @@ -41,28 +42,22 @@ class UserProvider extends BaseUserProvider implements AccountConnectorInterface */ protected $customerRepository; - /** - * @var RepositoryInterface - */ - protected $userRepository; - /** * @var ObjectManager */ protected $userManager; /** - * @param RepositoryInterface $customerRepository - * @param RepositoryInterface $userRepository - * @param RepositoryInterface $oauthRepository - * @param ObjectManager $userManager - * @param CanonicalizerInterface $canonicalizer + * @param RepositoryInterface $customerRepository + * @param UserRepositoryInterface $userRepository + * @param RepositoryInterface $oauthRepository + * @param ObjectManager $userManager + * @param CanonicalizerInterface $canonicalizer */ - public function __construct(RepositoryInterface $customerRepository, RepositoryInterface $userRepository,RepositoryInterface $oauthRepository, ObjectManager $userManager, CanonicalizerInterface $canonicalizer) + public function __construct(RepositoryInterface $customerRepository, UserRepositoryInterface $userRepository, RepositoryInterface $oauthRepository, ObjectManager $userManager, CanonicalizerInterface $canonicalizer) { parent::__construct($userRepository, $canonicalizer); - $this->customerRepository = $customerRepository; - $this->userRepository = $userRepository; + $this->customerRepository = $customerRepository; $this->oauthRepository = $oauthRepository; $this->userManager = $userManager; }