Skip to content

Commit

Permalink
fixed short array CS in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 16, 2019
1 parent 9c70d1a commit 4401fe8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Command/CacheClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ protected function buildContainer()
// filter container's resources, removing reference to temp kernel file
\$resources = \$container->getResources();
\$filteredResources = array();
\$filteredResources = [];
foreach (\$resources as \$resource) {
if ((string) \$resource !== __FILE__) {
\$filteredResources[] = \$resource;
Expand Down
4 changes: 2 additions & 2 deletions Kernel/MicroKernelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ abstract protected function configureRoutes(RouteCollectionBuilder $routes);
*
* You can register extensions:
*
* $c->loadFromExtension('framework', array(
* $c->loadFromExtension('framework', [
* 'secret' => '%secret%'
* ));
* ]);
*
* Or services:
*
Expand Down
8 changes: 4 additions & 4 deletions Templating/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
*
* You can pass options during the call:
*
* <?php echo view['form']->form($form, array('attr' => array('class' => 'foo'))) ?>
* <?php echo view['form']->form($form, ['attr' => ['class' => 'foo']]) ?>
*
* <?php echo view['form']->form($form, array('separator' => '+++++')) ?>
* <?php echo view['form']->form($form, ['separator' => '+++++']) ?>
*
* This method is mainly intended for prototyping purposes. If you want to
* control the layout of a form in a more fine-grained manner, you are
Expand Down Expand Up @@ -124,9 +124,9 @@ public function end(FormView $view, array $variables = [])
*
* You can pass options during the call:
*
* <?php echo $view['form']->widget($form, array('attr' => array('class' => 'foo'))) ?>
* <?php echo $view['form']->widget($form, ['attr' => ['class' => 'foo']]) ?>
*
* <?php echo $view['form']->widget($form, array('separator' => '+++++')) ?>
* <?php echo $view['form']->widget($form, ['separator' => '+++++']) ?>
*
* @param FormView $view The view for which to render the widget
* @param array $variables Additional variables passed to the template
Expand Down
20 changes: 10 additions & 10 deletions Tests/Fixtures/Resources/views/translation.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
<?php echo $view['translator']->transChoice(
'{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
10,
array('%count%' => 10)
['%count%' => 10]
) ?>

<?php echo $view['translator']->trans('other-domain-test-no-params-short-array', array(), 'not_messages'); ?>
<?php echo $view['translator']->trans('other-domain-test-no-params-short-array', [], 'not_messages'); ?>

<?php echo $view['translator']->trans('other-domain-test-no-params-long-array', array(), 'not_messages'); ?>
<?php echo $view['translator']->trans('other-domain-test-no-params-long-array', [], 'not_messages'); ?>

<?php echo $view['translator']->trans('other-domain-test-params-short-array', array('foo' => 'bar'), 'not_messages'); ?>
<?php echo $view['translator']->trans('other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?>

<?php echo $view['translator']->trans('other-domain-test-params-long-array', array('foo' => 'bar'), 'not_messages'); ?>
<?php echo $view['translator']->trans('other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?>

<?php echo $view['translator']->transChoice('other-domain-test-trans-choice-short-array-%count%', 10, array('%count%' => 10), 'not_messages'); ?>
<?php echo $view['translator']->transChoice('other-domain-test-trans-choice-short-array-%count%', 10, ['%count%' => 10], 'not_messages'); ?>

<?php echo $view['translator']->transChoice('other-domain-test-trans-choice-long-array-%count%', 10, array('%count%' => 10), 'not_messages'); ?>
<?php echo $view['translator']->transChoice('other-domain-test-trans-choice-long-array-%count%', 10, ['%count%' => 10], 'not_messages'); ?>

<?php echo $view['translator']->trans('typecast', array('a' => (int) '123'), 'not_messages'); ?>
<?php echo $view['translator']->transChoice('msg1', 10 + 1, array(), 'not_messages'); ?>
<?php echo $view['translator']->transChoice('msg2', ceil(4.5), array(), 'not_messages'); ?>
<?php echo $view['translator']->trans('typecast', ['a' => (int) '123'], 'not_messages'); ?>
<?php echo $view['translator']->transChoice('msg1', 10 + 1, [], 'not_messages'); ?>
<?php echo $view['translator']->transChoice('msg2', ceil(4.5), [], 'not_messages'); ?>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
<label>Custom name label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>
<label>Custom name label: <?php echo $view->escape($view['translator']->trans($label, [], $translation_domain)) ?></label>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!$label) {
$label = $view['form']->humanize($name);
} ?>
<label>Custom label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>
<label>Custom label: <?php echo $view->escape($view['translator']->trans($label, [], $translation_domain)) ?></label>

0 comments on commit 4401fe8

Please sign in to comment.