protected function _getSourceFiles($dir)
{
$files = [];
$dh = opendir($dir);
while ($file = readdir($dh)) {
if (Text::startsWith($file, '.')) {
continue;
}
$file = str_replace('\\', '/', $dir) . '/' . $file;
if (is_dir($file)) {
$files = array_merge($files, $this->_getSourceFiles($file));
} else {
if (fnmatch('*.php', $file)) {
$files[] = $file;
}
}
}
closedir($dh);
return $files;
}