mirror of
				https://github.com/Mibew/mibew.git
				synced 2025-10-31 18:41:10 +03:00 
			
		
		
		
	Implement "AuthenticationManagerAwareInterface" in "ControllerResolver" class
This commit is contained in:
		
							parent
							
								
									184e6ccdc3
								
							
						
					
					
						commit
						8dbc46145c
					
				| @ -23,7 +23,7 @@ use Mibew\Routing\RouterAwareInterface; | |||||||
| use Symfony\Component\Routing\RouterInterface; | use Symfony\Component\Routing\RouterInterface; | ||||||
| use Symfony\Component\HttpFoundation\Request; | use Symfony\Component\HttpFoundation\Request; | ||||||
| 
 | 
 | ||||||
| class ControllerResolver implements RouterAwareInterface | class ControllerResolver implements RouterAwareInterface, AuthenticationManagerAwareInterface | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|      * @var RouterInterface|null |      * @var RouterInterface|null | ||||||
| @ -64,6 +64,22 @@ class ControllerResolver implements RouterAwareInterface | |||||||
|         $this->router = $router; |         $this->router = $router; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * {@inheritdoc} | ||||||
|  |      */ | ||||||
|  |     public function getAuthenticationManager() | ||||||
|  |     { | ||||||
|  |         return $this->authenticationManager; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * {@inheritdoc} | ||||||
|  |      */ | ||||||
|  |     public function setAuthenticationManager(AuthenticationManagerInterface $manager) | ||||||
|  |     { | ||||||
|  |         $this->authenticationManager = $manager; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Resolves controller by request. |      * Resolves controller by request. | ||||||
|      * |      * | ||||||
| @ -122,7 +138,7 @@ class ControllerResolver implements RouterAwareInterface | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if ($object instanceof AuthenticationManagerAwareInterface) { |         if ($object instanceof AuthenticationManagerAwareInterface) { | ||||||
|             $object->setAuthenticationManager($this->authenticationManager); |             $object->setAuthenticationManager($this->getAuthenticationManager()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return array($object, $method); |         return array($object, $method); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user