$this->sheet of type boolean|string is incompatible with the type integer expected by parameter $worksheetIndex of PhpOffice\PhpSpreadsheet...::setActiveSheetIndex().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation