$value) { if (property_exists($this, $key)) { $this->{$key} = $value; } } } public static function fromByAuthService(AuthService $service): self { return new self( [ 'isLogin' => $service->isLoggedIn(), 'uid' => $service->getUID(), 'name' => $service->getName(), 'role' => $service->getRole(), //배열(array|null)을 반환합니다. ] ); } }