Skip to content

Commit 491e07f

Browse files
authored
Update User.php
php8.1 test error handle
1 parent 548d20b commit 491e07f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Behavioral/Observer/User.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ public function __construct()
2222
$this->observers = new SplObjectStorage();
2323
}
2424

25-
public function attach(SplObserver $observer)
25+
public function attach(SplObserver $observer): void
2626
{
2727
$this->observers->attach($observer);
2828
}
2929

30-
public function detach(SplObserver $observer)
30+
public function detach(SplObserver $observer): void
3131
{
3232
$this->observers->detach($observer);
3333
}
3434

35-
public function changeEmail(string $email)
35+
public function changeEmail(string $email): void
3636
{
3737
$this->email = $email;
3838
$this->notify();
3939
}
4040

41-
public function notify()
41+
public function notify(): void
4242
{
4343
/** @var SplObserver $observer */
4444
foreach ($this->observers as $observer) {

0 commit comments

Comments
 (0)