Enjoyzz /
cookie
| 1 | <?php |
||||
| 2 | |||||
| 3 | use Enjoys\Cookie\Cookie; |
||||
| 4 | |||||
| 5 | include __DIR__."/../vendor/autoload.php"; |
||||
| 6 | // |
||||
| 7 | // |
||||
| 8 | //$cookieOptions = new \Enjoys\Cookie\Options(); |
||||
| 9 | //$cookieOptions->setDomain(false); |
||||
| 10 | //$cookieOptions->setPath('/'); |
||||
| 11 | //$cookieOptions->setHttponly(true); |
||||
| 12 | |||||
| 13 | $cookie = new Cookie(new \Enjoys\Cookie\Options()); |
||||
|
0 ignored issues
–
show
|
|||||
| 14 | |||||
| 15 | |||||
| 16 | |||||
| 17 | $cookie->set('token', '<>', 'session'); |
||||
| 18 | $cookie->setRaw('token4', '<>', 'session'); |
||||
| 19 | $cookie->set('token2', time(), 3600, [ |
||||
| 20 | 'samesite' => 'strict' |
||||
| 21 | ]); |
||||
| 22 | var_dump(Cookie::has('token4')); |
||||
|
0 ignored issues
–
show
The method
Enjoys\Cookie\Cookie::has() is not static, but was called statically.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 23 | //var_dump($cookie); |
||||
| 24 | //var_dump($_COOKIE); |
||||
| 25 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.