Skip to content

Commit c220723

Browse files
committed
Merge branch 'release/0.8.1'
2 parents f584a60 + 9a285e6 commit c220723

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 8,
5-
"patch": 0,
5+
"patch": 1,
66
"build": 0
77
}

VERSIONLOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.8.1 2025-11-07
2+
13
* Added comprehensive rate limiting system with multiple storage backends.
24
* Added RateLimitFilter for request throttling.
35
* Added Redis, File, and Memory storage implementations for rate limiting.
@@ -8,7 +10,7 @@
810
* Added comprehensive tests for rate limiting functionality.
911
* Added IPResolver.
1012

11-
## 0.6.10 2025-11-04
13+
## 0.8.0 2025-11-04
1214
## 0.6.9 2025-05-21
1315

1416
## 0.6.8 2025-02-18

src/Routing/Router.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,21 @@ public function getRoute( int $Method, string $Uri ) : ?RouteMap
355355
return null;
356356
}
357357

358-
protected function executePreFilters( RouteMap $Route ): void
358+
protected function executePreFilters( RouteMap $Route ): mixed
359359
{
360360
foreach( $this->_Filter as $FilterName )
361361
{
362362
$Filter = $this->getFilter( $FilterName );
363-
$Filter->pre( $Route );
363+
$Result = $Filter->pre( $Route );
364+
365+
// If filter returns a non-null value, stop execution and return it
366+
if( $Result !== null )
367+
{
368+
return $Result;
369+
}
364370
}
371+
372+
return null;
365373
}
366374

367375
protected function executePostFilters( RouteMap $Route ): void
@@ -380,7 +388,13 @@ protected function executePostFilters( RouteMap $Route ): void
380388

381389
public function dispatch( RouteMap $Route ): mixed
382390
{
383-
$this->executePreFilters( $Route );
391+
$FilterResult = $this->executePreFilters( $Route );
392+
393+
// If a filter returned a response, return it immediately without executing the route
394+
if( $FilterResult !== null )
395+
{
396+
return $FilterResult;
397+
}
384398

385399
$Result = $Route->execute( $this );
386400

0 commit comments

Comments
 (0)