File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -763,14 +763,13 @@ public function moodleoverflow_get_post_ratings(): object {
763763 $ discussionid = $ this ->get_discussion ()->get_id ();
764764 $ postratings = ratings::moodleoverflow_get_ratings_by_discussion ($ discussionid , $ this ->id );
765765
766- $ ratingsobject = new stdClass ();
767- $ ratingsobject ->upvotes = $ postratings ->upvotes ;
768- $ ratingsobject ->downvotes = $ postratings ->downvotes ;
769- $ ratingsobject ->votesdifference = $ postratings ->upvotes - $ postratings ->downvotes ;
770- $ ratingsobject ->markedhelpful = $ postratings ->ishelpful ;
771- $ ratingsobject ->markedsolution = $ postratings ->issolved ;
772-
773- return $ ratingsobject ;
766+ return (object ) [
767+ 'upvotes ' => $ postratings ->upvotes ,
768+ 'downvotes ' => $ postratings ->downvotes ,
769+ 'votesdifference ' => $ postratings ->upvotes - $ postratings ->downvotes ,
770+ 'markedhelpful ' => $ postratings ->ishelpful ,
771+ 'markedsolution ' => $ postratings ->issolved ,
772+ ];
774773 }
775774
776775 /**
You can’t perform that action at this time.
0 commit comments