for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Core\Dependency;
class Cookie{
/**
* set a cookie
* @param string $name
* @param string $value
* @param string $expireDate
*/
public function setCookie(string $name, string $value, string $expireDate):void
{
setcookie($name, $value, $expireDate, "/");
$expireDate
string
integer
$expire
setcookie()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
setcookie($name, $value, /** @scrutinizer ignore-type */ $expireDate, "/");
}
* delete a named cookie
public function deleteCookie(string $name):void
setcookie($name, "", time()-3600); //expire the cookie
* get a cookie
* @return mixed
public function getCookie(string $name)
return $_COOKIE[$name] ?? false;