public function __construct($path, $checkPath = true) { if ($checkPath && !is_file($path)) { throw new FileNotFoundException($path); } parent::__construct($path); }
/** * {@inheritdoc} */ public function __construct($path, $checkPath = true) { parent::__construct($path, $checkPath); if (false === strpos($this->getMimeType(), 'image')) { throw new \Exception(sprintf('Is not an image file. (%s)', $this->getMimeType())); } }