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
@@ -27,10 +27,8 @@ class ChatBotController extends Controller
* Display a listing of the Bots resource.
*
* @param null $hash
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index($hash = null)
public function index($hash = null): \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$bots = Bot::orderBy('position', 'ASC')->get();
@@ -42,12 +40,10 @@ class ChatBotController extends Controller
/**
* Show the form for editing the specified Bot resource.
*
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function edit(Request $request, $id)
public function edit(Request $request, $id): \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$user = $request->user();
$bot = Bot::findOrFail($id);
@@ -61,9 +57,7 @@ class ChatBotController extends Controller
/**
* Update the specified Bot resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)