acceptedProcessInterface = Process::class; } /** * Run pipeline * * @param Content $page * * @return Content */ function run(Content $page) { $this->runBeforeStart($page); foreach ($this->processes as $process) { /** * @var $run Process */ $run = new $process; $run->handle($page); } $this->runBeforeRender($page); return $page; } protected function runBeforeStart($page) { if (!is_null($this->beforeStart)) { $process = new $this->beforeStart; $process->handle($page); } } protected function runBeforeRender($page) { if (!is_null($this->beforeRender)) { $process = new $this->beforeRender; $process->handle($page); } } }