getPhpFiles($fileTypes)); } } else { $phpFiles = $fileUtilities->getPhpFiles($fileTypes); } return $phpFiles; } /** * Get changed content. * * @param string $fileName * @return string */ public static function getChangedContent($fileName) { $data = []; $extension = self::getFileExtension($fileName); $fileName = ltrim(str_replace(BP, '', $fileName), DIRECTORY_SEPARATOR); $changedFilesContentFile = BP . sprintf(self::CHANGED_FILES_CONTENT_FILE, $extension); if (file_exists($changedFilesContentFile)) { $changedContent = file_get_contents($changedFilesContentFile); $data = json_decode($changedContent, true); } return isset($data[$fileName]) ? $data[$fileName] : ''; } /** * Get file extension. * * @param string $fileName * @return string */ public static function getFileExtension($fileName) { $fileInfo = pathinfo($fileName); return isset($fileInfo['extension']) ? $fileInfo['extension'] : 'unknown'; } }