public function load($resource) { if (!$resource instanceof Imagick) { throw new \InvalidArgumentException("Passed variable is not an instance of Imagick"); } parent::load($resource); }