コード例 #1
0
 /**
  * @inheritDoc
  */
 public function detect(HandlerFactoryInterface $handlerFactory, RequestFile $requestFile)
 {
     $testIsWebM = in_array($requestFile->getType(), ['video/webm', 'audio/webm'], true);
     if ($testIsWebM) {
         return $handlerFactory->createFromStringCode('webm', $requestFile);
     }
     return false;
 }
コード例 #2
0
 /**
  * @inheritDoc
  */
 public function detect(HandlerFactoryInterface $handlerFactory, RequestFile $requestFile)
 {
     $testIsImage = in_array($requestFile->getType(), $this->allowedMIMETypes, true);
     if ($testIsImage) {
         return $handlerFactory->createFromStringCode('image', $requestFile);
     }
     return false;
 }