if ($request->attributes->
has(SecurityRequestAttributes::ACCESS_DENIED_ERROR
)) { $newRequest->attributes->
set(SecurityRequestAttributes::ACCESS_DENIED_ERROR,
$request->attributes->
get(SecurityRequestAttributes::ACCESS_DENIED_ERROR
));
} if ($request->attributes->
has(SecurityRequestAttributes::LAST_USERNAME
)) { $newRequest->attributes->
set(SecurityRequestAttributes::LAST_USERNAME,
$request->attributes->
get(SecurityRequestAttributes::LAST_USERNAME
));
} if ($request->
get('_format'
)) { $newRequest->attributes->
set('_format',
$request->
get('_format'
));
} if ($request->
getDefaultLocale() !==
$request->
getLocale()) { $newRequest->
setLocale($request->
getLocale());
} return $newRequest;
} /**
* Checks that a given path matches the Request.
*
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
*
* @return bool true if the path is the same as the one from the Request, false otherwise
*/