elkarte / Elkarte

ElkArte Forum. A free, open source, modern discussion forum / BB
https://elkarte.github.io/Elkarte/
BSD 3-Clause "New" or "Revised" License
175 stars 61 forks source link

Continuation of freshen mode #3757

Closed Spuds closed 6 months ago

Spuds commented 6 months ago

Continuation of going through the controllers to "freshen" the php level in a few areas.

use static on closures that don't need $this
arrow functions fn() => for some one line closures
replace those \ElkArte\AdminController\XYZ calls with an import and XYZ::class
some hardening
useless else removal
early returns
remove list()
cast ints in some of the queries
positive logic in some if
codecov[bot] commented 6 months ago

Codecov Report

Attention: 287 lines in your changes are missing coverage. Please review.

Comparison is base (5659aa4) 33.99% compared to head (c1eba29) 34.39%. Report is 1 commits behind head on development.

Files Patch % Lines
sources/ElkArte/Database/Mysqli/Query.php 2.04% 96 Missing :warning:
...rces/ElkArte/Graphics/Manipulators/ImageMagick.php 42.22% 26 Missing :warning:
sources/ElkArte/Database/Postgresql/Table.php 20.00% 20 Missing :warning:
sources/ElkArte/Database/Mysqli/Dump.php 6.66% 14 Missing :warning:
sources/ElkArte/Database/AbstractQuery.php 67.56% 12 Missing :warning:
sources/ElkArte/Errors/Log.php 0.00% 11 Missing :warning:
sources/ElkArte/Graphics/Manipulators/Gd2.php 0.00% 11 Missing :warning:
sources/ElkArte/Errors/ErrorContext.php 54.54% 10 Missing :warning:
sources/ElkArte/Graphics/Image.php 40.00% 9 Missing :warning:
sources/ElkArte/Converters/Html2BBC.php 38.46% 8 Missing :warning:
... and 18 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #3757 +/- ## ================================================= + Coverage 33.99% 34.39% +0.39% + Complexity 16582 16571 -11 ================================================= Files 436 436 Lines 84028 84007 -21 ================================================= + Hits 28566 28892 +326 + Misses 55462 55115 -347 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.