-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from sunrise-php/release/v2.13.0
v2.13.0
- Loading branch information
Showing
6 changed files
with
235 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## v2.13.0 | ||
|
||
* Supports for events using the `symfony/event-dispatcher`. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* It's free open-source software released under the MIT License. | ||
* | ||
* @author Anatoly Fenric <[email protected]> | ||
* @copyright Copyright (c) 2018, Anatoly Fenric | ||
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE | ||
* @link https://github.com/sunrise-php/http-router | ||
*/ | ||
|
||
namespace Sunrise\Http\Router\Event; | ||
|
||
/** | ||
* Import classes | ||
*/ | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Sunrise\Http\Router\RouteInterface; | ||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
/** | ||
* RouteEvent | ||
* | ||
* @since 2.13.0 | ||
*/ | ||
final class RouteEvent extends Event | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public const NAME = 'router.route'; | ||
|
||
/** | ||
* @var RouteInterface | ||
*/ | ||
private $route; | ||
|
||
/** | ||
* @var ServerRequestInterface | ||
*/ | ||
private $request; | ||
|
||
/** | ||
* Constructor of the class | ||
* | ||
* @param RouteInterface $route | ||
* @param ServerRequestInterface $request | ||
*/ | ||
public function __construct(RouteInterface $route, ServerRequestInterface $request) | ||
{ | ||
$this->route = $route; | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* @return RouteInterface | ||
*/ | ||
public function getRoute() : RouteInterface | ||
{ | ||
return $this->route; | ||
} | ||
|
||
/** | ||
* @return ServerRequestInterface | ||
*/ | ||
public function getRequest() : ServerRequestInterface | ||
{ | ||
return $this->request; | ||
} | ||
|
||
/** | ||
* @param ServerRequestInterface $request | ||
* | ||
* @return void | ||
*/ | ||
public function setRequest(ServerRequestInterface $request) : void | ||
{ | ||
$this->request = $request; | ||
} | ||
} |
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
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