2017-07-27 4 views

答えて

0

私は方法を見つけました...しかし、それはかなりハッキーです。私は、他の人を助けることができるという希望でここに掲示しています。

解決策は実際にはApiGenではなく、roave/better-reflectionです。具体的には、ファイルsrc/SourceLocator/Type/FileIteratorSourceLocator.phpのメソッドgetAggregatedSourceLocatorで、無名関数で指定します。

置き換えます

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) 
    )))); 
} 

をして:

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) 
    )))); 
} 

作品のよう47b76f7をコミットし、バージョン何か

関連する問題