width = $options['width']; $this->height = $options['height']; parent::__construct($app); } public function check(EntityManager $em, File $file) { $boolean = false; if (method_exists($file->getMedia(), 'getWidth')) { $boolean = $file->getMedia()->getWidth() >= $this->width && $file->getMedia()->getHeight() >= $this->height; } return new Response($boolean, $this); } public function getMessage(TranslatorInterface $translator) { return $translator->trans('The file does not match required dimension'); } }