As @stof mentioned in the comments, you can remove the type hint on `File` here as it extends `SplFileInfo` (same below.)