mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-20 16:33:35 +00:00
Глава 34: корректура
This commit is contained in:
@ -14,7 +14,7 @@ class User
|
||||
|
||||
public function __get(string $index) : ?string
|
||||
{
|
||||
if($index == 'password') {
|
||||
if ($index == 'password') {
|
||||
throw new PasswordException;
|
||||
}
|
||||
if (isset($this->$index)) {
|
||||
@ -26,12 +26,11 @@ class User
|
||||
|
||||
public function __set(string $index, string $value) : void
|
||||
{
|
||||
if (isset($this->$index)) {
|
||||
$this->$index = $value;
|
||||
}
|
||||
else {
|
||||
throw new AttributeException($index);
|
||||
}
|
||||
if (isset($this->$index)) {
|
||||
$this->$index = $value;
|
||||
} else {
|
||||
throw new AttributeException($index);
|
||||
}
|
||||
}
|
||||
|
||||
public function isPasswordCorrect($password)
|
||||
|
Reference in New Issue
Block a user