```php
if ($innerIterator instanceof RecursiveDirectoryIterator && $innerIterator->isRewindable()) {