Skip to content

Commit b3c4d63

Browse files
committed
minor #40314 improve exception message if symfony/security-csrf is missing (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- improve exception message if symfony/security-csrf is missing | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #37452 | License | MIT | Doc PR | Commits ------- 1a26ed4 improve exception message if symfony/security-csrf is missing
2 parents a5683c5 + 1a26ed4 commit b3c4d63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/FormRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
5959
public function renderCsrfToken($tokenId)
6060
{
6161
if (null === $this->csrfTokenManager) {
62-
throw new BadMethodCallException('CSRF tokens can only be generated if a CsrfTokenManagerInterface is injected in FormRenderer::__construct().');
62+
throw new BadMethodCallException('CSRF tokens can only be generated if a CsrfTokenManagerInterface is injected in FormRenderer::__construct(). Try running "composer require symfony/security-csrf".');
6363
}
6464

6565
return $this->csrfTokenManager->getToken($tokenId)->getValue();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy