private function getFileChanges(Commit $commit, $skipVpdbFiles)
{
$changedFiles = $commit->getChangedFiles();
if ($skipVpdbFiles) {
$changedFiles = array_filter($changedFiles, function ($changedFile) {
$path = str_replace('\\', '/', realpath(VP_PROJECT_ROOT) . '/' . $changedFile['path']);
$vpdbPath = str_replace('\\', '/', realpath(VP_VPDB_DIR));
return !Strings::startsWith($path, $vpdbPath);
});
}
$fileChanges = array_map(function ($changedFile) {
$status = $changedFile['status'];
$filename = $changedFile['path'];
return ['type' => 'file', 'action' => $status === 'A' ? 'add' : ($status === 'M' ? 'modify' : 'delete'), 'name' => $filename];
}, $changedFiles);
return $fileChanges;
}