Exemplo n.º 1
0
 /**
  * Validate
  *
  * @param  \Upload\FileInfoInterface  $fileInfo
  * @throws \RuntimeException          If validation fails
  */
 public function validate(FileInfoInterface $fileInfo)
 {
     //Profiler::debugPoint(true,__METHOD__, __FILE__, __LINE__,$this->mimetypes);
     if (in_array($fileInfo->getMimetype(), $this->mimetypes) === false) {
         Profiler::debugPoint(true, __METHOD__, __FILE__, __LINE__, $this->mimetypes);
         throw new Exception(sprintf('Invalid mimetype. Must be one of: %s', implode(', ', $this->mimetypes)), $fileInfo);
     }
 }