🔧
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user