19declare(strict_types=1);
36 '.*/components/ILIAS/Setup/',
37 '.*/components/ILIAS/GlobalScreen/tests/',
41 '.*/components/ILIAS/Setup/classes/',
43 '.*ilPDExternalFeedBlockGUI.*',
53 $this->root = substr(__FILE__, 0, strpos(__FILE__, DIRECTORY_SEPARATOR .
"components"));
54 $external_classmap = include(__DIR__ .
"/../../../../vendor/composer/vendor/composer/autoload_classmap.php");
55 $this->classmap = $external_classmap ?:
null;
72 callable $is_matching,
73 array $additional_ignore = [],
74 ?
string $matching_path =
null
78 $reflection_class = new \ReflectionClass($class_name);
79 if ($is_matching($reflection_class)) {
82 }
catch (\Throwable
$e) {
91 protected function getAllClassNames(array $additional_ignore, ?
string $matching_path =
null): \Iterator
93 $ignore = array_merge($this->ignore, $additional_ignore);
95 if (!is_array($this->classmap)) {
96 throw new \LogicException(
"Composer ClassMap not loaded");
103 fn($v):
string =>
"(" . str_replace(
'/',
'(/|\\\\)', $v) .
")",
107 if ($matching_path) {
108 $matching_path = str_replace(
'/',
'(/|\\\\)', $matching_path);
112 foreach ($this->classmap as $class_name => $file_path) {
113 $real_path = realpath($file_path);
114 if ($real_path ===
false) {
115 throw new \RuntimeException(
116 "Could not find file for class $class_name (path: $file_path). " .
117 "Please check the composer classmap, maybe it is outdated. " .
118 "You can regenerate it by executing 'composer du' or 'composer install' " .
119 "(which also ensures dependencies are correctly installed) in the ILIAS root directory."
123 $path = str_replace($this->root,
"", $real_path);
124 if ($matching_path && !preg_match(
"#^" . $matching_path .
"$#", $path)) {
127 if (!preg_match(
"#^" . $regexp .
"$#", $path)) {
getAllClassNames(array $additional_ignore, ?string $matching_path=null)
genericGetMatchingClassNames(callable $is_matching, array $additional_ignore=[], ?string $matching_path=null)
The matcher finds the class names implementing the given interface, while ignoring paths in self::$ig...
foreach( $report as $row)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...