/** * Set the value of an annotation. * * @param string $fieldName * @param string $name * @param mixed $value * * @return static */ public function withFieldAnnotation($fieldName, $name, $value) { $copy = clone $this; $copy->annotations = $this->annotations->update($fieldName, function (ArrayMap $fieldAnnotations) use($name, $value) { return $fieldAnnotations->insert($name, $value); }, ArrayMap::zero()); return $copy; }