@@ -30,6 +30,26 @@ final class SymbolsConfiguration
3030 private SymbolRegistry $ exposedFunctions ;
3131 private SymbolRegistry $ exposedConstants ;
3232
33+ /**
34+ * @var string[]
35+ */
36+ private array $ excludedClassNames ;
37+
38+ /**
39+ * @var string[]
40+ */
41+ private array $ excludedFunctionNames ;
42+
43+ /**
44+ * @var string[]
45+ */
46+ private array $ excludedConstantNames ;
47+
48+ /**
49+ * @param string[] $excludedClassNames
50+ * @param string[] $excludedFunctionNames
51+ * @param string[] $excludedConstantNames
52+ */
3353 public static function create (
3454 bool $ exposeGlobalConstants = false ,
3555 bool $ exposeGlobalClasses = false ,
@@ -40,7 +60,10 @@ public static function create(
4060 ?NamespaceRegistry $ exposedNamespaces = null ,
4161 SymbolRegistry $ exposedClasses = null ,
4262 SymbolRegistry $ exposedFunctions = null ,
43- SymbolRegistry $ exposedConstants = null
63+ SymbolRegistry $ exposedConstants = null ,
64+ array $ excludedClassNames = [],
65+ array $ excludedFunctionNames = [],
66+ array $ excludedConstantNames = []
4467 ): self {
4568 return new self (
4669 $ exposeGlobalConstants ,
@@ -51,9 +74,17 @@ public static function create(
5174 $ exposedClasses ?? SymbolRegistry::create (),
5275 $ exposedFunctions ?? SymbolRegistry::create (),
5376 $ exposedConstants ?? SymbolRegistry::createForConstants (),
77+ $ excludedClassNames ,
78+ $ excludedFunctionNames ,
79+ $ excludedConstantNames ,
5480 );
5581 }
5682
83+ /**
84+ * @param string[] $excludedClassNames
85+ * @param string[] $excludedFunctionNames
86+ * @param string[] $excludedConstantNames
87+ */
5788 private function __construct (
5889 bool $ exposeGlobalConstants ,
5990 bool $ exposeGlobalClasses ,
@@ -62,7 +93,10 @@ private function __construct(
6293 NamespaceRegistry $ exposedNamespaces ,
6394 SymbolRegistry $ exposedClasses ,
6495 SymbolRegistry $ exposedFunctions ,
65- SymbolRegistry $ exposedConstants
96+ SymbolRegistry $ exposedConstants ,
97+ array $ excludedClassNames ,
98+ array $ excludedFunctionNames ,
99+ array $ excludedConstantNames
66100 ) {
67101 $ this ->exposeGlobalConstants = $ exposeGlobalConstants ;
68102 $ this ->exposeGlobalClasses = $ exposeGlobalClasses ;
@@ -72,6 +106,9 @@ private function __construct(
72106 $ this ->exposedClasses = $ exposedClasses ;
73107 $ this ->exposedFunctions = $ exposedFunctions ;
74108 $ this ->exposedConstants = $ exposedConstants ;
109+ $ this ->excludedClassNames = $ excludedClassNames ;
110+ $ this ->excludedFunctionNames = $ excludedFunctionNames ;
111+ $ this ->excludedConstantNames = $ excludedConstantNames ;
75112 }
76113
77114 public function shouldExposeGlobalConstants (): bool
@@ -113,4 +150,28 @@ public function getExposedConstants(): SymbolRegistry
113150 {
114151 return $ this ->exposedConstants ;
115152 }
153+
154+ /**
155+ * @return string[]
156+ */
157+ public function getExcludedClassNames (): array
158+ {
159+ return $ this ->excludedClassNames ;
160+ }
161+
162+ /**
163+ * @return string[]
164+ */
165+ public function getExcludedFunctionNames (): array
166+ {
167+ return $ this ->excludedFunctionNames ;
168+ }
169+
170+ /**
171+ * @return string[]
172+ */
173+ public function getExcludedConstantNames (): array
174+ {
175+ return $ this ->excludedConstantNames ;
176+ }
116177}
0 commit comments