Skip to content

Commit

Permalink
bug #20882 [TwigBridge] fix constructor args check (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.2 branch.

Discussion
----------

[TwigBridge] fix constructor args check

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony-docs#7242
| License       | MIT
| Doc PR        |

Commits
-------

fa82588 [TwigBridge] fix constructor args check
  • Loading branch information
fabpot committed Dec 13, 2016
2 parents d93024b + fa82588 commit 8e19e2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/FormExtension.php
Expand Up @@ -31,7 +31,7 @@ class FormExtension extends \Twig_Extension implements \Twig_Extension_InitRunti

public function __construct($renderer = null)
{
if ($this->renderer instanceof TwigRendererInterface) {
if ($renderer instanceof TwigRendererInterface) {
@trigger_error(sprintf('Passing a Twig Form Renderer to the "%s" constructor is deprecated since version 3.2 and won\'t be possible in 4.0. Pass the Twig_Environment to the TwigRendererEngine constructor instead.', static::class), E_USER_DEPRECATED);
} elseif (null !== $renderer && !(is_array($renderer) && isset($renderer[0], $renderer[1]) && $renderer[0] instanceof ContainerInterface)) {
throw new \InvalidArgumentException(sprintf('Passing any arguments the constructor of %s is reserved for internal use.', __CLASS__));
Expand Down

0 comments on commit 8e19e2c

Please sign in to comment.