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