Candidate::fromArray( $array )

In this article

{@inheritDoc}

Source

public static function fromArray(array $array): self
{
    static::validateFromArrayData($array, [self::KEY_MESSAGE, self::KEY_FINISH_REASON]);
    $messageData = $array[self::KEY_MESSAGE];
    return new self(Message::fromArray($messageData), FinishReasonEnum::from($array[self::KEY_FINISH_REASON]));
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.