Detect mime type for files.
Based on https://github.com/Muraad/Mime-Detective
try {
$detector = new \MimeTypeDetector('/path/to/file.doc');
$type = $detector->getFileType();
var_dump($type);
} catch (\MimeType\Exception\FileException $e) {
echo $e->getMessage();
}
Each type of file have its unique scheme protocol, found them and compare.
-
Check Code Style https://github.com/squizlabs/PHP_CodeSniffer
-
Check Syntax https://github.com/php-parallel-lint/PHP-Parallel-Lint
-
Code Checker https://github.com/phpmd/phpmd