Ich fand einen Weg ... aber es ist ziemlich hacky. Ich poste es hier in der Hoffnung, dass es jemand anderem helfen könnte. Die Lösung ist nicht tatsächlich in ApiGen, sondern in roave/better-reflection. Insbesondere in der Datei src/SourceLocator/Type/FileIteratorSourceLocator.php
, in der Methode getAggregatedSourceLocator
, in einer anonymen Funktion.
ersetzen:
private function getAggregatedSourceLocator() : AggregateSourceLocator
{
return $this->aggregateSourceLocator ?: new AggregateSourceLocator(array_values(array_filter(array_map(
function (\SplFileInfo $item) : ?SingleFileSourceLocator {
- if (! ($item->isFile() && pathinfo($item->getRealPath(), \PATHINFO_EXTENSION) === 'php')) {
return null;
}
return new SingleFileSourceLocator($item->getRealPath());
},
iterator_to_array($this->fileSystemIterator)
))));
}
mit:
private function getAggregatedSourceLocator() : AggregateSourceLocator
{
return $this->aggregateSourceLocator ?: new AggregateSourceLocator(array_values(array_filter(array_map(
function (\SplFileInfo $item) : ?SingleFileSourceLocator {
+ $flag = in_array(pathinfo($item->getRealPath(), \PATHINFO_EXTENSION), ['php', 'class']);
+ if (! ($item->isFile() && $flag)) {
return null;
}
return new SingleFileSourceLocator($item->getRealPath());
},
iterator_to_array($this->fileSystemIterator)
))));
}
Arbeiten ab 47b76f7 begehen, Version etwas