This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -28,14 +28,14 @@ final class FragmentUriGenerator implements FragmentUriGeneratorInterface
private ?UriSigner $signer;
private ?RequestStack $requestStack;
public function __construct(string $fragmentPath, UriSigner $signer = null, RequestStack $requestStack = null)
public function __construct(string $fragmentPath, ?UriSigner $signer = null, ?RequestStack $requestStack = null)
{
$this->fragmentPath = $fragmentPath;
$this->signer = $signer;
$this->requestStack = $requestStack;
}
public function generate(ControllerReference $controller, Request $request = null, bool $absolute = false, bool $strict = true, bool $sign = true): string
public function generate(ControllerReference $controller, ?Request $request = null, bool $absolute = false, bool $strict = true, bool $sign = true): string
{
if (null === $request && (null === $this->requestStack || null === $request = $this->requestStack->getCurrentRequest())) {
throw new \LogicException('Generating a fragment URL can only be done when handling a Request.');