mirror of
				https://github.com/webmasterskaya/joomla-oauth-server.git
				synced 2025-10-31 07:43:22 +03:00 
			
		
		
		
	implement RequestEvent
This commit is contained in:
		
							parent
							
								
									abf67a1c6a
								
							
						
					
					
						commit
						e9271cb7ec
					
				
							
								
								
									
										30
									
								
								com_oauthserver/administrator/src/Event/RequestEvent.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								com_oauthserver/administrator/src/Event/RequestEvent.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,30 @@ | ||||
| <?php | ||||
| /** | ||||
|  * @package         Joomla.Administrator | ||||
|  * @subpackage      com_oauthserver | ||||
|  * | ||||
|  * @copyright   (c) 2024. Webmasterskaya. <https://webmasterskaya.xyz> | ||||
|  * @license         MIT; see LICENSE.txt | ||||
|  **/ | ||||
| 
 | ||||
| namespace Webmasterskaya\Component\OauthServer\Administrator\Event; | ||||
| 
 | ||||
| use Psr\Http\Message\ServerRequestInterface; | ||||
| 
 | ||||
| class RequestEvent extends AbstractImmutableEvent | ||||
| { | ||||
|     public function __construct(string $name, array $arguments = []) | ||||
|     { | ||||
|         if (!array_key_exists('request', $arguments)) | ||||
|         { | ||||
|             throw new \BadMethodCallException("Argument 'request' is required for event $name"); | ||||
|         } | ||||
| 
 | ||||
|         parent::__construct($name, ['request' => $arguments['request']]); | ||||
|     } | ||||
| 
 | ||||
|     protected function onSetRequest(ServerRequestInterface $request): ServerRequestInterface | ||||
|     { | ||||
|         return $request; | ||||
|     } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user