refactor: better php8 usage

- Change simple property init and assign to constructor promotion
- Remove unused variable in catch()
- Change docs types to union types, where possible
This commit is contained in:
HDVinnie
2021-05-15 22:41:28 -04:00
parent 041927202c
commit 3407075214
174 changed files with 237 additions and 1365 deletions
@@ -28,8 +28,6 @@ class ModerationController extends Controller
{
/**
* ModerationController Constructor.
*
* @param \App\Repositories\ChatRepository $chatRepository
*/
public function __construct(private ChatRepository $chatRepository)
{
@@ -37,10 +35,8 @@ class ModerationController extends Controller
/**
* Torrent Moderation Panel.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$current = Carbon::now();
$pending = Torrent::with(['user', 'category', 'type'])->pending()->get();
@@ -96,7 +92,6 @@ class ModerationController extends Controller
/**
* Postpone A Torrent.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse
*/
@@ -133,7 +128,6 @@ class ModerationController extends Controller
/**
* Reject A Torrent.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse
*/