Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit e6dec06

Browse files
Never rely on dynamic properties
1 parent e9ca378 commit e6dec06

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Core/Exception/AuthenticationException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@
2121
*/
2222
class AuthenticationException extends RuntimeException
2323
{
24+
/** @internal */
25+
protected $serialized;
26+
2427
private $token;
2528

29+
public function __construct(string $message = '', int $code = 0, \Throwable $previous = null)
30+
{
31+
unset($this->serialized);
32+
parent::__construct($message, $code, $previous);
33+
}
34+
2635
/**
2736
* Get the token.
2837
*

Core/Tests/Exception/CustomUserMessageAuthenticationExceptionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
class ChildCustomUserMessageAuthenticationException extends CustomUserMessageAuthenticationException
1919
{
20+
public $childMember;
21+
2022
public function __serialize(): array
2123
{
2224
return [$this->childMember, parent::__serialize()];

0 commit comments

Comments
 (0)