mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
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:
@@ -22,10 +22,8 @@ class ArticleController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display All Articles.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
{
|
||||
$articles = Article::latest()->paginate(6);
|
||||
|
||||
@@ -36,10 +34,8 @@ class ArticleController extends Controller
|
||||
* Show A Article.
|
||||
*
|
||||
* @param \App\Models\Article $id
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function show($id)
|
||||
public function show($id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
{
|
||||
$article = Article::with(['user', 'comments'])->findOrFail($id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user