public function invoke($args) { if (!$this->hasCallsLeft() && $this->nextIsActive()) { return $this->next->invoke($args); } if ($this->callsLeft !== null) { $this->callsLeft--; } return $this->doInvoke($args); }