File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
dev/tools/Magento/Tools/Di/Code/Reader Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
class ClassesScanner
12
12
{
13
+ /**
14
+ * @var array
15
+ */
16
+ protected $ excludePatterns = [];
17
+
18
+ /**
19
+ * adds exclude patterns
20
+ *
21
+ * @param array $excludePatterns
22
+ */
23
+ public function addExcludePatterns (array $ excludePatterns )
24
+ {
25
+ $ this ->excludePatterns = array_merge ($ this ->excludePatterns , $ excludePatterns );
26
+ }
27
+
13
28
/**
14
29
* Retrieves list of classes for given path
15
30
*
@@ -37,6 +52,11 @@ public function getList($path)
37
52
if ($ fileItem ->getExtension () !== 'php ' ) {
38
53
continue ;
39
54
}
55
+ foreach ($ this ->excludePatterns as $ excludePattern ) {
56
+ if (preg_match ($ excludePattern , $ fileItem ->getRealPath ())) {
57
+ continue 2 ;
58
+ }
59
+ }
40
60
$ fileScanner = new FileScanner ($ fileItem ->getRealPath ());
41
61
$ classNames = $ fileScanner ->getClassNames ();
42
62
foreach ($ classNames as $ className ) {
You can’t perform that action at this time.
0 commit comments