mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-25 18:53:25 +02:00
Merge pull request #360 from guilhermesiani/patch-1
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