1 | <?php |
||
22 | class CurrentUserCookie extends Storage |
||
23 | { |
||
24 | /** |
||
25 | * {@inheritDoc} |
||
26 | */ |
||
27 | public function __construct(Controller $controller, ?string $key = null, array $config = []) |
||
33 | |||
34 | /** |
||
35 | * {@inheritDoc} |
||
36 | */ |
||
37 | public function write($id): void |
||
43 | |||
44 | /** |
||
45 | * Gets cookie values |
||
46 | * |
||
47 | * @return null|array cookie values if found, null otherwise |
||
48 | */ |
||
49 | public function read(): ?array |
||
67 | |||
68 | /** |
||
69 | * Refreshs the cookie so that regularly visiting users aren't logged-out |
||
70 | * |
||
71 | * Cookie is valid for 30 days and is renewed if used for loggin-in within 7 |
||
72 | * days before expiring. |
||
73 | * |
||
74 | * @param array $cookie cookie-data |
||
75 | * @return void |
||
76 | */ |
||
77 | private function refresh(array $cookie): void |
||
90 | } |
||
91 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.