/** * @param string $type * @param AvroName $name * @param string $doc documentation string * @param AvroNamedSchemata &$schemata * @throws AvroSchemaParseException */ public function __construct($type, $name, $doc = null, &$schemata = null) { parent::__construct($type); $this->name = $name; if ($doc && !is_string($doc)) { throw new AvroSchemaParseException('Schema doc attribute must be a string'); } $this->doc = $doc; if (!is_null($schemata)) { $schemata = $schemata->clone_with_new_schema($this); } }