discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
992 stars 236 forks source link

Optimize Part fill and mutator #1178

Closed SQKo closed 1 year ago

SQKo commented 1 year ago

Optimize Part::fill() and Part::studly() also split Part::checkForMutator() to Part::checkForGetMutator() and Part::checkForSetMutator() to follow according Laravel v10 code

Previously Part:fill() will iterate through fillable array and call the setAttribute that also checks for the fillable array again which is unnecessary

The redundancy of checkForSetMutator to be used in fill() and setAttribute() also helps identify which mutator calls are expensive, as identified in #1175