diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php index 648eb36d4b..af3b972cdf 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php @@ -3,7 +3,7 @@ return new class { public $proxyClass; - private $privates = array(); + private $privates = []; public function getFooService($lazyLoad = true) { diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php index a72891aa5d..984e2e2a1b 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php @@ -136,7 +136,7 @@ class ProxyDumperTest extends TestCase return new class { public \$proxyClass; - private \$privates = array(); + private \$privates = []; public function getFooService(\$lazyLoad = true) { diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php index 3ab6c95eef..de85603a53 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php @@ -49,7 +49,7 @@ class TranslationExtensionTest extends TestCase * @group legacy * @dataProvider getTransChoiceTests */ - public function testTransChoice($template, $expected, array $variables = array()) + public function testTransChoice($template, $expected, array $variables = []) { $this->testTrans($template, $expected, $variables); } @@ -98,48 +98,48 @@ class TranslationExtensionTest extends TestCase ['{% trans into "fr"%}Hello{% endtrans %}', 'Hello'], // trans with count - array( + [ '{% trans from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}', 'There is no apples', - array('count' => 0), - ), - array( + ['count' => 0], + ], + [ '{% trans %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}', 'There is 5 apples', - array('count' => 5), - ), - array( + ['count' => 5], + ], + [ '{% trans %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtrans %}', 'There is 5 apples (Symfony)', - array('count' => 5, 'name' => 'Symfony'), - ), - array( + ['count' => 5, 'name' => 'Symfony'], + ], + [ '{% trans with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtrans %}', 'There is 5 apples (Symfony)', - array('count' => 5), - ), - array( + ['count' => 5], + ], + [ '{% trans into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}', 'There is no apples', - array('count' => 0), - ), - array( + ['count' => 0], + ], + [ '{% trans count 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}', 'There is 5 apples', - ), + ], // trans filter - array('{{ "Hello"|trans }}', 'Hello'), - array('{{ name|trans }}', 'Symfony', array('name' => 'Symfony')), - array('{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', array('hello' => 'Hello %name%')), - array('{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', array('hello' => 'Hello %name%')), - array('{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'), + ['{{ "Hello"|trans }}', 'Hello'], + ['{{ name|trans }}', 'Symfony', ['name' => 'Symfony']], + ['{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', ['hello' => 'Hello %name%']], + ['{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', ['hello' => 'Hello %name%']], + ['{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'], // trans filter with count - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans(count=count) }}', 'There is 5 apples', array('count' => 5)), - array('{{ text|trans(count=5, arguments={\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')), - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans({}, "messages", "fr", count) }}', 'There is 5 apples', array('count' => 5)), - ); + ['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans(count=count) }}', 'There is 5 apples', ['count' => 5]], + ['{{ text|trans(count=5, arguments={\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', ['text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)']], + ['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans({}, "messages", "fr", count) }}', 'There is 5 apples', ['count' => 5]], + ]; } /** @@ -147,18 +147,18 @@ class TranslationExtensionTest extends TestCase */ public function getTransChoiceTests() { - return array( + return [ // trans tag - array('{% trans %}Hello{% endtrans %}', 'Hello'), - array('{% trans %}%name%{% endtrans %}', 'Symfony', array('name' => 'Symfony')), + ['{% trans %}Hello{% endtrans %}', 'Hello'], + ['{% trans %}%name%{% endtrans %}', 'Symfony', ['name' => 'Symfony']], - array('{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'), + ['{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'], - array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', array('name' => 'Symfony')), - array('{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'), - array('{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'), + ['{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', ['name' => 'Symfony']], + ['{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'], + ['{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'], - array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'), + ['{% trans into "fr"%}Hello{% endtrans %}', 'Hello'], // transchoice [ diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_help.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_help.html.php index 605f860cad..1490e7ab5f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_help.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_help.html.php @@ -1,4 +1,4 @@ -

block($form, 'attributes', array('attr' => $help_attr)); ?>>escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help); ?>

+

block($form, 'attributes', ['attr' => $help_attr]); ?>>escape(false !== $translation_domain ? $view['translator']->trans($help, [], $translation_domain) : $help); ?>

diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index c2a94af5ac..de6a01c90e 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -316,7 +316,7 @@ abstract class Client public function submit(Form $form, array $values = []/*, array $serverParameters = []*/) { if (\func_num_args() < 3 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) { - @trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = array()" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = []" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED); } $form->setValues($values); @@ -330,7 +330,7 @@ abstract class Client * uses it to submit the given form field values. * * @param string $button The text content, id, value or name of the form