The expression return $this->category->getId() could return the type null which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
The expression return $category->getUrlKey() could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.