It seems like $filters can also be of type callable; however, parameter $filter of ByTIC\MediaLibrary\Media...getFilteredCollection() does only seem to accept array, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
$this of type ByTIC\MediaLibrary\HasMedia\HasMediaTrait is incompatible with the type Nip\Records\Record expected by parameter $record of ByTIC\MediaLibrary\Media...Repository::setRecord().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation