text; } /** * Number of users that voted for this option * * @return int */ public function getVoterCount(): int { return $this->voter_count; } /** * Returns an array representation of the object * * @return array */ public function toArray(): array { return [ 'text' => $this->text, 'voter_count' => $this->voter_count, ]; } /** * Constructs an object from an array representation * * @param array $data * @return PollOption */ public static function fromArray(array $data): self { $object = new self(); $object->text = $data['text'] ?? null; $object->voter_count = $data['voter_count'] ?? null; return $object; } }