public function collectDir(string
$dir, string
$ext = '.twig'
): array
{ $iterator =
new \
RegexIterator( new \
RecursiveIteratorIterator( new \
RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY
), '{'.
preg_quote($ext).'$}'
);
return $this->
collect(new TemplateDirIterator($iterator));
} /**
* Returns deprecations for passed templates.
*
* @param \Traversable $iterator An iterator of templates (where keys are template names and values the contents of the template)
*
* @return array An array of deprecations
*/
public function collect(\Traversable
$iterator): array
{