tweaked the exception message

This commit is contained in:
lsmith77 2012-01-23 18:16:35 +01:00
parent 3a1699a420
commit cc31a157d3
2 changed files with 2 additions and 2 deletions

View File

@ -299,7 +299,7 @@ class FormExtension extends \Twig_Extension
public function getCsrfToken($intention)
{
if (!$this->csrfProvider instanceof CsrfProviderInterface) {
throw new \BadMethodCallException('CSRF token can only be generated if the "form.csrf_provider" service is available');
throw new \BadMethodCallException('CSRF token can only be generated if a CsrfProviderInterface is injected in the constructor.');
}
return $this->csrfProvider->generateCsrfToken($intention);

View File

@ -203,7 +203,7 @@ class FormHelper extends Helper
public function csrfToken($intention)
{
if (!$this->csrfProvider instanceof CsrfProviderInterface) {
throw new \BadMethodCallException('CSRF token can only be generated if the "form.csrf_provider" service is available');
throw new \BadMethodCallException('CSRF token can only be generated if a CsrfProviderInterface is injected in the constructor.');
}
return $this->csrfProvider->generateCsrfToken($intention);