symfony/symfony — pull request #10772 by jakzal (2014-04-23 20:28:04+00:00)
Title: [Finder] Fix ignoring of unreadable dirs in the RecursiveDirectoryIterator

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10747
| License | MIT
| Doc PR | -

`\RecursiveDirectoryIterator::getChildren()` creates an instance of the current (overloaded) class with default constructor arguments. Therefore the `ignoreUnreadableDirs` is not passed to the child directories as @marcj suggested in #10747.

My fix relies on PHP's ability to modify private properties in objects of the same class. My reasoning behind choosing this approach, instead of using a setter, is that it's an internal detail which doesn't need to be part of a public interface.

Unfortunately, I can't really cover this case by tests.