I used to code in Laravel, and I'm pretty good with it.
I've moved from VSCode to PhpStorm 2019.3, and it is enforcing me like it has intentions inside for language features, it gives me a little warning message that you should declare this closure method as static.
I know PhpStorm2019.3 fully supports PHP 7.4. So, the question is this, that should I always create closures functions as static like
Route::get('/', function () {
return view('posts', [
'posts' => Post::all()
]);
});
// without static closure
Route::get('/posts/{post}', function (Post $post) {
return view('post', [
'post' => $post
]);
});
// with static closure
Route::get('/posts/{post}', static function (Post $post) {
return view('post', [
'post' => $post
]);
});
and is it good practice or bad practice? Because I found PhpStorm the best IDE in the world for PHP and Laravel developers.