@@ -156,6 +156,49 @@ public function getSeverity(): string
156156
157157 public function toArray (): array
158158 {
159- return get_object_vars ($ this );
159+ $ data = [
160+ 'ticket_id ' => $ this ->ticket_id ,
161+ 'summary ' => $ this ->summary ,
162+ 'user_id ' => $ this ->user_id ,
163+ 'assigned_to_id ' => $ this ->assigned_to_id ,
164+ 'votes ' => $ this ->votes ,
165+ 'created_at ' => $ this ->created_at ,
166+ 'updated_at ' => $ this ->updated_at ,
167+ 'is_closed ' => $ this ->is_closed ,
168+ 'owner ' => [
169+ 'name ' => $ this ->owner ,
170+ ],
171+ 'assignee ' => $ this ->assignee ? [
172+ 'name ' => $ this ->assignee ,
173+ ] : null ,
174+ 'type ' => [
175+ 'name ' => $ this ->type ,
176+ ],
177+ 'milestone ' => $ this ->milestone ? [
178+ 'name ' => $ this ->milestone ,
179+ 'slug ' => $ this ->milestone_slug ,
180+ ] : null ,
181+ 'version ' => $ this ->version ? [
182+ 'name ' => $ this ->version ,
183+ 'slug ' => $ this ->version_slug ,
184+ ] : null ,
185+ 'component ' => $ this ->component ? [
186+ 'name ' => $ this ->component ,
187+ ] : null ,
188+ 'status ' => [
189+ 'name ' => $ this ->status ,
190+ ],
191+ 'priority ' => [
192+ 'name ' => $ this ->priority ,
193+ ],
194+ 'severity ' => [
195+ 'name ' => $ this ->severity ,
196+ ],
197+ 'project ' => [
198+ 'slug ' => $ this ->project_slug ,
199+ ],
200+ ];
201+
202+ return $ data ;
160203 }
161204}
0 commit comments