nextcloud/lib/private/AppFramework/Http/RequestId.php
Josh 0071a97f89
chore(RequestId): drop duplicate getId docblock from implementation
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-06-08 11:36:43 +02:00

30 lines
634 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\AppFramework\Http;
use OCP\IRequestId;
use OCP\Security\ISecureRandom;
class RequestId implements IRequestId {
public function __construct(
protected string $requestId,
protected ISecureRandom $secureRandom,
) {
}
#[\Override]
public function getId(): string {
if (empty($this->requestId)) {
$validChars = ISecureRandom::CHAR_ALPHANUMERIC;
$this->requestId = $this->secureRandom->generate(20, $validChars);
}
return $this->requestId;
}
}