How to ignore any subfolder in the finder component?
<p>Assume a file structure:</p>

<pre><code>config
    └── folder
        └── subfolder
</code></pre>

<p>I want to iterate over the files using the <a href="http://symfony.com/doc/current/components/finder.html" rel="noreferrer">finder component</a> of only the content folder using the symfony finder component but not any subfolder.</p>

<p>Currently, the only way I found to exclude the subfolder is a hardcoded:</p>

<pre><code>foreach($fileFinder-&gt;in($portalConfigPath)-&gt;files()-&gt;exclude('subfolder') as $file) {...}
</code></pre>

<p>How to exclude any new subfolder that may be added in the future? I tried <code>'*'</code> as a wildcard, yet it doesn't work here.</p>