The line:
public function children()
should be like this in Kirby 4
public function children(): Pages