-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow extra fields in config to protect from typos (#52)
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 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,20 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace BrandEmbassy\Slim\Route; | ||
|
||
use RuntimeException; | ||
use function implode; | ||
use function sprintf; | ||
|
||
final class InvalidRouteDefinitionException extends RuntimeException | ||
{ | ||
/** | ||
* @param string[] $path | ||
*/ | ||
public function __construct(array $path, string $hint) | ||
{ | ||
parent::__construct( | ||
sprintf('Unexpected route definition key in "%s", did you mean "%s"?', implode(' › ', $path), $hint) | ||
); | ||
} | ||
} |
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,21 @@ | ||
extensions: | ||
slimApi: \BrandEmbassy\Slim\DI\SlimApiExtension | ||
|
||
|
||
services: | ||
- BrandEmbassyTest\Slim\Sample\BeforeRouteMiddleware | ||
- BrandEmbassyTest\Slim\Sample\HelloWorldRoute | ||
|
||
slimApi: | ||
apiPrefix: '/tests' | ||
slimConfiguration: | ||
settings: | ||
removeDefaultHandlers: true | ||
|
||
routes: | ||
"app": | ||
"/hello-world": | ||
get: | ||
service: BrandEmbassyTest\Slim\Sample\HelloWorldRoute | ||
middleware: | ||
- BrandEmbassyTest\Slim\Sample\BeforeRouteMiddleware |