|
|
<?php |
|
|
|
|
|
namespace Kanboard\Core\Controller; |
|
|
|
|
|
use Kanboard\Core\Base; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract class BaseMiddleware extends Base |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
protected $nextMiddleware = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract public function execute(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function setNextMiddleware(BaseMiddleware $nextMiddleware) |
|
|
{ |
|
|
$this->nextMiddleware = $nextMiddleware; |
|
|
return $this; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getNextMiddleware() |
|
|
{ |
|
|
return $this->nextMiddleware; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function next() |
|
|
{ |
|
|
if ($this->nextMiddleware !== null) { |
|
|
if (DEBUG) { |
|
|
$this->logger->debug(__METHOD__.' => ' . get_class($this->nextMiddleware)); |
|
|
} |
|
|
|
|
|
$this->nextMiddleware->execute(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|