*/ private $results = []; /** * Adds an update result to the collection. * * @param Update_Result $result The update result to add. * * @return void */ public function add( Update_Result $result ): void { $this->results[] = $result; } /** * Returns the update results in the collection. * * @return array The update results in the collection. */ public function get(): array { return $this->results; } /** * Parses the collection to the expected key value representation. * * @return array>> The collection presented as the expected key value representation. */ public function to_array(): array { $results = []; foreach ( $this->results as $result ) { $results[] = $result->to_array(); } return [ 'results' => $results ]; } }