mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 20:50:15 +02:00
Keep one level of conditions
This commit is contained in:
@@ -29,11 +29,9 @@ abstract class Handler
|
||||
{
|
||||
$processed = $this->processing($request);
|
||||
|
||||
if ($processed === null) {
|
||||
if ($processed === null && $this->successor !== null) {
|
||||
// the request has not been processed by this handler => see the next
|
||||
if ($this->successor !== null) {
|
||||
$processed = $this->successor->handle($request);
|
||||
}
|
||||
$processed = $this->successor->handle($request);
|
||||
}
|
||||
|
||||
return $processed;
|
||||
|
Reference in New Issue
Block a user