/** * Review any text based file. * * @link http://stackoverflow.com/a/632786 * * @param ReviewableInterface $file * * @return bool */ public function canReview(ReviewableInterface $file) { $mime = $file->getMimeType(); // check to see if the mime-type starts with 'text' return substr($mime, 0, 4) === 'text'; }