refactor: preslash simple functions

- Add pre-slash to short named functions to improve performance by almost 30%
-  @see https://stackoverflow.com/questions/55419673/php7-adding-a-slash-to-all-standard-php-functions-php-cs-fixer-rule
This commit is contained in:
HDVinnie
2020-07-22 15:09:37 -04:00
parent e7ccde0190
commit a975116218
211 changed files with 2497 additions and 2497 deletions
@@ -30,7 +30,7 @@ class NotificationController extends Controller
{
$notifications = $request->user()->notifications()->paginate(25);
return view('notification.index', ['notifications' => $notifications]);
return \view('notification.index', ['notifications' => $notifications]);
}
/**
@@ -126,7 +126,7 @@ class NotificationController extends Controller
$notifications = $notification->paginate(25);
return view('notification.results', [
return \view('notification.results', [
'user' => $user,
'notifications' => $notifications,
])->render();
@@ -145,7 +145,7 @@ class NotificationController extends Controller
$notification = $request->user()->notifications()->findOrFail($id);
$notification->markAsRead();
return redirect()->to($notification->data['url'])
return \redirect()->to($notification->data['url'])
->withSuccess('Notification Marked As Read!');
}
@@ -162,18 +162,18 @@ class NotificationController extends Controller
$notification = $request->user()->notifications()->where('id', '=', $id)->first();
if (! $notification) {
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withErrors('Notification Does Not Exist!');
}
if ($notification->read_at != null) {
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withErrors('Notification Already Marked As Read!');
}
$notification->markAsRead();
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withSuccess('Notification Marked As Read!');
}
@@ -191,7 +191,7 @@ class NotificationController extends Controller
$carbon = new Carbon();
$request->user()->unreadNotifications()->update(['read_at' => $carbon]);
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withSuccess('All Notifications Marked As Read!');
}
@@ -207,7 +207,7 @@ class NotificationController extends Controller
{
$request->user()->notifications()->findOrFail($id)->delete();
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withSuccess('Notification Deleted!');
}
@@ -222,7 +222,7 @@ class NotificationController extends Controller
{
$request->user()->notifications()->delete();
return redirect()->route('notifications.index')
return \redirect()->route('notifications.index')
->withSuccess('All Notifications Deleted!');
}
}