extensions = array_map('strtolower', (array) $options['extensions']); parent::__construct($app); } public function check(EntityManager $em, File $file) { if (0 === count($this->extensions)) { //if empty authorize all extensions $boolean = true; } else { $boolean = in_array(strtolower($file->getFile()->getExtension()), $this->extensions); } return new Response($boolean, $this); } public function getMessage(TranslatorInterface $translator) { return $translator->trans('The file does not match available extensions'); } }