-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change middleware stoppage and refactor
- Loading branch information
Showing
15 changed files
with
212 additions
and
98 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 |
---|---|---|
|
@@ -3,13 +3,6 @@ | |
"description": "ExpressJS-like router for PHP", | ||
"type": "library", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "kahlan", | ||
"test2": "kahlan --reporter=verbose", | ||
"cov": "kahlan --coverage", | ||
"check": "phpstan analyze src", | ||
"l1": "phpstan analyze src --level=1" | ||
}, | ||
"require": { | ||
"php": ">=7.4", | ||
"ext-mbstring": "*", | ||
|
@@ -25,10 +18,10 @@ | |
"phputil\\router\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Thiago Delgado Pinto", | ||
"email": "[email protected]" | ||
} | ||
] | ||
"scripts": { | ||
"test": "kahlan", | ||
"test2": "kahlan --reporter=verbose", | ||
"cov": "kahlan --coverage", | ||
"check": "phpstan analyze src --level=3" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<?php | ||
namespace phputil\router; | ||
|
||
const ENTRY_HTTP = 'h'; | ||
const ENTRY_GROUP = 'g'; | ||
const ENTRY_MIDDLEWARE = 'm'; | ||
use function str_replace; | ||
use function implode; | ||
|
||
interface Entry { | ||
function type(); | ||
} | ||
|
||
const ENTRY_HTTP = 'h'; | ||
const ENTRY_GROUP = 'g'; | ||
const ENTRY_MIDDLEWARE = 'm'; | ||
|
||
/** | ||
* Join routes in a single URL path. | ||
*/ | ||
function joinRoutes( array $routes ) { | ||
return \str_replace( '//', '/', \implode( '/', $routes ) ); | ||
return str_replace( '//', '/', implode( '/', $routes ) ); | ||
} | ||
|
||
?> |
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
Oops, something went wrong.