Significantly improves DX with LSP compatibility. Now it's possible to navigate to the definition of these functions in laravel and get ide autocomplete.
Every time a user switches rooms or sends a pm, we need to ensure the sender and recipient have an echo and an audible. Previously, every user's echoes and audibles were cached, and we checked to see if the cached value contained the appropriate recipient, and if not, created the echo/audible and sent the user a new list. Now, we try to create it by default, and if it was created, send the user the new list.
A simple keyed insert doesn't take a lot of compute so it doesn't need to be cached.
There were a few type errors here.
I don't like that I'm casting the $amount to a float, but the only alternatives are not using the query builder, by either using `->update(['seedbonus' => DB::raw("seedbonus + $amount")])` after regex validation, or using `DB::update("update users set seedbonus = seedbonus + ? where id = ?", [$amount, $recipient->id])`. This is an issue in other parts of the code base as well.
I'm open to any feedback.
When the user changes the bot in the front-end (e.g. clicks the systembot button), it calls the bot pm method with an empty string and the pm method creates audibles/echoes but doesn't create the message if it's an empty string. Feels like an awfully hacky method, so I'm making the logic more explicit.
This breaks the pint CI currently. This is probably due to the next version of php (8.4) adding opcache optimizations to sprintf and our config requiring pre-slashing native functions.
Lots were wrong with these files. Updated them to more modern standards, fixed some larastan errors, and fixed some issues with the IRC bot as well. They could still use some further clean up as is.
- github action updated with new ruleset in pint.json
- codebase linted with new ruleset
- contributors can now run `./vendor/bin/pint`
- action workflow will auto correct any lint issues upon commit/opened pull request
- Change simple property init and assign to constructor promotion
- Remove unused variable in catch()
- Change docs types to union types, where possible