public function __invoke(Request $req, Response $res) { $school = $req->getAttribute('school', false); if (!$school) { return $res->withStatus(403, 'No school'); } $this->service->setTotalTeachers($school->id, (int) $req->getParam('total_teachers', 0)); return $res->withStatus(204); }