discordphp.org
@discordphp.org
We’re excited to keep improving! Let us know what features or improvements you'd love to see next. Feedback is always welcome. 💬

👉 Full release notes here: github.com/discord-php/...
Release v10.2.2 · discord-php/DiscordPHP
What's Changed ✨ Add sort method to Collections by @valzargaming and @Log1x in #1276 ✨ Add slide, sort, map methods to Collections and Repositories by @valzargaming ✨ Add parameters to serialize f...
github.com
January 17, 2025 at 3:31 AM
Want a practical example? Check this out:
Ever needed the last 10 people who joined your guild? Now you can do it in one clean expression:
January 17, 2025 at 3:31 AM
We’ve also enhanced the serialize method for Collections! 🛠️
You can now pass parameters like JSON_PRETTY_PRINT to json_encode. Your debug outputs and file exports just got a glow-up! 🌟
January 17, 2025 at 3:31 AM
The return type of these methods has been updated to use a new CollectionInterface type hint in the docs.
⚠️ Don’t worry, no code changes are needed on your end. It’s fully backwards compatible!
These improvements will be more significant in v11, so stay tuned. 👀
January 17, 2025 at 3:31 AM
This release focuses on Collections and Repositories with 3 new methods:
✅ sort – Inspired by illuminate/collections. Sorts your data and returns a fresh Collection object.
✅ map – Mapping now works for Repositories too! Bug fixed.
✅ slice – Extract new Collections with ease!
January 17, 2025 at 3:31 AM