}
preg_match_all( '/^\s*[AM]\s+(.*?)\r?$/m', $output, $matches );
- $this->mFiles = array_merge( $this->mFiles, $matches[1] );
+ foreach ( $matches[1] as $file ) {
+ if ( self::isSuitableFile( $file ) && !is_dir( $file ) ) {
+ $this->mFiles[] = $file;
+ }
+ }
return;
}
$this->output( "done.\n" );
}
+
+ /**
+ * Returns true if $file is of a type we can check
+ */
+ private static function isSuitableFile( $file ) {
+ $ext = pathinfo( $file, PATHINFO_EXTENSION );
+ return $ext == 'php' || $ext == 'inc' || $ext == 'php5';
+ }
/**
* Add given path to file list, searching it in include path if needed
RecursiveIteratorIterator::SELF_FIRST
);
foreach ( $iterator as $file ) {
- $ext = pathinfo( $file->getFilename(), PATHINFO_EXTENSION );
- if ( $ext == 'php' || $ext == 'inc' || $ext == 'php5' ) {
+ if ( self::isSuitableFile( $file->getRealPath() ) ) {
$this->mFiles[] = $file->getRealPath();
}
}