minor #13638 [TwigBridge] Removed duplicated code from TwigRenderer (hason)
This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #13638).
Discussion
----------
[TwigBridge] Removed duplicated code from TwigRenderer
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
See https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/FormRenderer.php#L65-L69
Commits
-------
1a9aca7
[TwigBridge] Removed duplicated code from TwigRenderer
This commit is contained in:
commit
d0c1c534b2
@ -11,11 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Bridge\Twig\Form;
|
namespace Symfony\Bridge\Twig\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
|
||||||
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter;
|
|
||||||
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
|
|
||||||
use Symfony\Component\Form\FormRenderer;
|
use Symfony\Component\Form\FormRenderer;
|
||||||
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||||
@ -29,12 +25,6 @@ class TwigRenderer extends FormRenderer implements TwigRendererInterface
|
|||||||
|
|
||||||
public function __construct(TwigRendererEngineInterface $engine, $csrfTokenManager = null)
|
public function __construct(TwigRendererEngineInterface $engine, $csrfTokenManager = null)
|
||||||
{
|
{
|
||||||
if ($csrfTokenManager instanceof CsrfProviderInterface) {
|
|
||||||
$csrfTokenManager = new CsrfProviderAdapter($csrfTokenManager);
|
|
||||||
} elseif (null !== $csrfTokenManager && !$csrfTokenManager instanceof CsrfTokenManagerInterface) {
|
|
||||||
throw new UnexpectedTypeException($csrfTokenManager, 'CsrfProviderInterface or CsrfTokenManagerInterface');
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::__construct($engine, $csrfTokenManager);
|
parent::__construct($engine, $csrfTokenManager);
|
||||||
|
|
||||||
$this->engine = $engine;
|
$this->engine = $engine;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.3",
|
"php": ">=5.3.3",
|
||||||
"symfony/security-csrf": "~2.4",
|
|
||||||
"twig/twig": "~1.13,>=1.13.1"
|
"twig/twig": "~1.13,>=1.13.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
Reference in New Issue
Block a user