-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 #2640 from l0gicgate/4.x-DecoupleFastRouteRouteParser
4.x - Decouple FastRoute RouteParser
- Loading branch information
Showing
8 changed files
with
552 additions
and
479 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
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,78 @@ | ||
<?php | ||
/** | ||
* Slim Framework (https://slimframework.com) | ||
* | ||
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Slim\Interfaces; | ||
|
||
use InvalidArgumentException; | ||
use Psr\Http\Message\UriInterface; | ||
use RuntimeException; | ||
|
||
/** | ||
* Interface RouteParserInterface | ||
* | ||
* @package Slim\Interfaces | ||
*/ | ||
interface RouteParserInterface | ||
{ | ||
/** | ||
* Build the path for a named route excluding the base path | ||
* | ||
* @param string $name Route name | ||
* @param array $data Named argument replacement data | ||
* @param array $queryParams Optional query string parameters | ||
* | ||
* @return string | ||
* | ||
* @throws RuntimeException If named route does not exist | ||
* @throws InvalidArgumentException If required data not provided | ||
*/ | ||
public function relativePathFor(string $name, array $data = [], array $queryParams = []): string; | ||
|
||
/** | ||
* Build the path for a named route including the base path | ||
* | ||
* This method is deprecated. Use urlFor() from now on. | ||
* | ||
* @param string $name Route name | ||
* @param array $data Named argument replacement data | ||
* @param array $queryParams Optional query string parameters | ||
* | ||
* @return string | ||
* | ||
* @throws RuntimeException If named route does not exist | ||
* @throws InvalidArgumentException If required data not provided | ||
*/ | ||
public function pathFor(string $name, array $data = [], array $queryParams = []): string; | ||
|
||
/** | ||
* Build the path for a named route including the base path | ||
* | ||
* @param string $name Route name | ||
* @param array $data Named argument replacement data | ||
* @param array $queryParams Optional query string parameters | ||
* | ||
* @return string | ||
* | ||
* @throws RuntimeException If named route does not exist | ||
* @throws InvalidArgumentException If required data not provided | ||
*/ | ||
public function urlFor(string $name, array $data = [], array $queryParams = []): string; | ||
|
||
/** | ||
* Get fully qualified URL for named route | ||
* | ||
* @param UriInterface $uri | ||
* @param string $routeName Route name | ||
* @param array $data Named argument replacement data | ||
* @param array $queryParams Optional query string parameters | ||
* | ||
* @return string | ||
*/ | ||
public function fullUrlFor(UriInterface $uri, string $routeName, array $data = [], array $queryParams = []): string; | ||
} |
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
Oops, something went wrong.