You can skip this check by instantiating the `RecursiveDirectoryIterator` with the `FilesystemIterator::SKIP_DOTS` flag.

```php
$it = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
```