for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
if($request->has('sso')){
session()->put('sso', $request->get('sso'));
session()->put('sig', $request->get('sig'));
}
if (! $request->expectsJson()) {
return route('login');
protected function authenticate($request, array $guards)
if (empty($guards)) {
$guards = [null];
foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
return $this->auth->shouldUse($guard);
$this->auth->shouldUse($guard)
Illuminate\Auth\AuthManager::shouldUse()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
if ($request->input('wiki_session_id') && $request->input('wiki_session_id') !== null) {
return;
$this->unauthenticated($request, $guards);
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.