$file of type array is incompatible with the type Illuminate\Contracts\Support\Arrayable expected by parameter $value of collect().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
16
collect(/** @scrutinizer ignore-type */ $file)->each(function ($media) use ($optimizerChain) {