@@ -40,6 +40,20 @@ public function getPaths(): array
40
40
return $ paths ;
41
41
}
42
42
43
+ private $ functionList ;
44
+
45
+ /**
46
+ * Returns the list of functions that must be ignored.
47
+ * @return string[]
48
+ */
49
+ private function getIgnoredFunctions (): array
50
+ {
51
+ if ($ this ->functionList === null ) {
52
+ $ this ->functionList = require __DIR__ .'/../config/ignoredFunctions.php ' ;
53
+ }
54
+ return $ this ->functionList ;
55
+ }
56
+
43
57
/**
44
58
* @return mixed[]
45
59
*/
@@ -49,6 +63,8 @@ public function getMethods(): array
49
63
$ overloadedFunctions = [];
50
64
$ paths = $ this ->getPaths ();
51
65
$ phpStanFunctionMapReader = new PhpStanFunctionMapReader ();
66
+ $ ignoredFunctions = $ this ->getIgnoredFunctions ();
67
+ $ ignoredFunctions = \array_combine ($ ignoredFunctions , $ ignoredFunctions );
52
68
foreach ($ paths as $ path ) {
53
69
$ module = \basename (\dirname ($ path , 2 ));
54
70
if (\in_array ($ module , $ this ->excludedModules )) {
@@ -62,11 +78,18 @@ public function getMethods(): array
62
78
$ overloadedFunctions = array_merge ($ overloadedFunctions , \array_map (function ($ functionObject ) {
63
79
return $ functionObject ->methodname ->__toString ();
64
80
}, $ functionObjects ));
81
+ $ overloadedFunctions = \array_filter ($ overloadedFunctions , function (string $ functionName ) use ($ ignoredFunctions ) {
82
+ return !isset ($ ignoredFunctions [$ functionName ]);
83
+ });
65
84
continue ;
66
85
}
67
86
$ rootEntity = $ docPage ->loadAndResolveFile ();
68
87
foreach ($ functionObjects as $ functionObject ) {
69
- $ functions [] = new Method ($ functionObject , $ rootEntity , $ docPage ->getModule (), $ phpStanFunctionMapReader );
88
+ $ function = new Method ($ functionObject , $ rootEntity , $ docPage ->getModule (), $ phpStanFunctionMapReader );
89
+ if (isset ($ ignoredFunctions [$ function ->getFunctionName ()])) {
90
+ continue ;
91
+ }
92
+ $ functions [] = $ function ;
70
93
}
71
94
}
72
95
}
0 commit comments