mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 23:40:45 +08:00
Remove unnecessary parameters
This commit is contained in:
parent
27b9c169fa
commit
4c66759c40
|
@ -35,29 +35,21 @@ class CookieFactory
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @param int $maxAge
|
* @param int $maxAge
|
||||||
* @param string $path
|
|
||||||
* @param bool $secure
|
|
||||||
* @param bool $httpOnly
|
|
||||||
* @param string $domain
|
|
||||||
* @return \Dflydev\FigCookies\SetCookie
|
* @return \Dflydev\FigCookies\SetCookie
|
||||||
*/
|
*/
|
||||||
public function make($name, $value = null, $maxAge = null, $path = null, $secure = null, $httpOnly = true, $domain = null)
|
public function make($name, $value = null, $maxAge = null)
|
||||||
{
|
{
|
||||||
$url = parse_url(rtrim($this->app->url(), '/'));
|
$url = parse_url(rtrim($this->app->url(), '/'));
|
||||||
|
|
||||||
if ($path === null) {
|
$path = array_get($url, 'path') ?: '/';
|
||||||
$path = array_get($url, 'path') ?: '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($secure === null && array_get($url, 'scheme') === 'https') {
|
$secure = array_get($url, 'scheme') === 'https';
|
||||||
$secure = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetCookie::create($name, $value)
|
return SetCookie::create($name, $value)
|
||||||
->withMaxAge($maxAge)
|
->withMaxAge($maxAge)
|
||||||
->withPath($path)
|
->withPath($path)
|
||||||
->withSecure($secure)
|
->withSecure($secure)
|
||||||
->withHttpOnly($httpOnly)
|
->withHttpOnly(true)
|
||||||
->withDomain($domain);
|
->withDomain(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user