Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / test / bootstrap.php
index 9526b648b2d3ab0c59b5270dadf5e950fcea20fd..0bfa9d0ad7ca1086275897039242357106d93407 100644 (file)
@@ -18,3 +18,14 @@ function canonicalize($str) {
     }, $lines);
     return implode("\n", $lines);
 }
+
+function filesInDir($directory, $fileExtension) {
+    $directory = realpath($directory);
+    $it = new \RecursiveDirectoryIterator($directory);
+    $it = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::LEAVES_ONLY);
+    $it = new \RegexIterator($it, '(\.' . preg_quote($fileExtension) . '$)');
+    foreach ($it as $file) {
+        $fileName = $file->getPathname();
+        yield $fileName => file_get_contents($fileName);
+    }
+}