We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab7f811 commit 8a59bb9Copy full SHA for 8a59bb9
lib/internal/Magento/Framework/App/Utility/RegexIteratorFactory.php
@@ -0,0 +1,26 @@
1
+<?php
2
+/**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+namespace Magento\Framework\App\Utility;
7
+
8
9
+ * Factory for \RegexIterator
10
11
+class RegexIteratorFactory
12
+{
13
+ /**
14
+ * Create instance of \RegexIterator
15
+ *
16
+ * @param string $directoryPath
17
+ * @param string $regexp
18
+ * @return \RegexIterator
19
20
+ public function create($directoryPath, $regexp)
21
+ {
22
+ $directory = new \RecursiveDirectoryIterator($directoryPath);
23
+ $recursiveIterator = new \RecursiveIteratorIterator($directory);
24
+ return new \RegexIterator($recursiveIterator, $regexp, \RegexIterator::GET_MATCH);
25
+ }
26
+}
0 commit comments