Skip to content

Commit 063ae13

Browse files
committed
CS: general fixes
1 parent 36948bb commit 063ae13

31 files changed

+64
-44
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
phpunit.xml
1+
.php_cs.cache
2+
autoload.php
23
composer.lock
34
composer.phar
4-
autoload.php
55
package*.tar
66
packages.json
7+
phpunit.xml
78
/vendor/

.php_cs

+22
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,26 @@
33
return Symfony\CS\Config\Config::create()
44
->setUsingLinter(false)
55
->setUsingCache(true)
6+
->finder(
7+
Symfony\CS\Finder\DefaultFinder::create()
8+
->in(__DIR__)
9+
->exclude(array(
10+
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
11+
'src/Symfony/Component/DependencyInjection/Tests/Fixtures',
12+
'src/Symfony/Component/Routing/Tests/Fixtures/dumper',
13+
// fixture templates
14+
'src/Symfony/Component/Templating/Tests/Fixtures/templates',
15+
// resource templates
16+
'src/Symfony/Bundle/FrameworkBundle/Resources/views/Form',
17+
))
18+
// file content autogenerated by `var_export`
19+
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
20+
// autogenerated xmls
21+
->notPath('src/Symfony/Component/Console/Tests/Fixtures/application_1.xml')
22+
->notPath('src/Symfony/Component/Console/Tests/Fixtures/application_2.xml')
23+
// yml
24+
->notPath('src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml')
25+
// test template
26+
->notPath('src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
27+
)
628
;

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
$required = false;
44
endif; ?>
55
<?php echo $view['form']->block($form, 'widget_attributes', array(
6-
'required' => $required
6+
'required' => $required,
77
)) ?>
88
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
99
>
10-
<?php if (null !== $empty_value): ?><option value=""<?php if ($required and empty($value) && "0" !== $value): ?> selected="selected"<?php endif?>><?php echo $view->escape($view['translator']->trans($empty_value, array(), $translation_domain)) ?></option><?php endif; ?>
10+
<?php if (null !== $empty_value): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo $view->escape($view['translator']->trans($empty_value, array(), $translation_domain)) ?></option><?php endif; ?>
1111
<?php if (count($preferred_choices) > 0): ?>
1212
<?php echo $view['form']->block($form, 'choice_widget_options', array('choices' => $preferred_choices)) ?>
1313
<?php if (count($choices) > 0 && null !== $separator): ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "hidden")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'hidden')) ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "number")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'number')) ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "text")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "password")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "text")) ?> %
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> %
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "search")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "url")) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?>

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This template is used for translation message extraction tests
22
<?php echo $view['translator']->trans('single-quoted key') ?>
3-
<?php echo $view['translator']->trans("double-quoted key") ?>
3+
<?php echo $view['translator']->trans('double-quoted key') ?>
44
<?php echo $view['translator']->trans(<<<EOF
55
heredoc key
66
EOF
@@ -15,11 +15,11 @@
1515
<?php echo $view['translator']->trans(
1616
'single-quoted key with whitespace and nonescaped \$\n\' sequences'
1717
) ?>
18-
<?php echo $view['translator']->trans( <<<EOF
18+
<?php echo $view['translator']->trans(<<<EOF
1919
heredoc key with whitespace and escaped \$\n sequences
2020
EOF
2121
) ?>
22-
<?php echo $view['translator']->trans( <<<'EOF'
22+
<?php echo $view['translator']->trans(<<<'EOF'
2323
nowdoc key with whitespace and nonescaped \$\n sequences
2424
EOF
2525
) ?>

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
2626
/**
2727
* Defines the position at which the provider is called.
2828
* Possible values: pre_auth, form, http, and remember_me.
29-
*
29+
*
3030
* @return string
3131
*/
3232
public function getPosition();

src/Symfony/Component/Console/Tests/Helper/TableHelperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testRenderProvider()
112112
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
113113
),
114114
TableHelper::LAYOUT_BORDERLESS,
115-
" =============== ========================== ================== \n ISBN Title Author \n =============== ========================== ================== \n 99921-58-10-7 Divine Comedy Dante Alighieri \n 9971-5-0210-0 A Tale of Two Cities Charles Dickens \n 960-425-059-0 The Lord of the Rings J. R. R. Tolkien \n 80-902734-1-6 And Then There Were None Agatha Christie \n =============== ========================== ================== \n"
115+
" =============== ========================== ================== \n ISBN Title Author \n =============== ========================== ================== \n 99921-58-10-7 Divine Comedy Dante Alighieri \n 9971-5-0210-0 A Tale of Two Cities Charles Dickens \n 960-425-059-0 The Lord of the Rings J. R. R. Tolkien \n 80-902734-1-6 And Then There Were None Agatha Christie \n =============== ========================== ================== \n",
116116
),
117117
array(
118118
array('ISBN', 'Title'),

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ private function startClass($class, $baseClass)
761761
$bagClass
762762
763763
/**
764-
* $class
764+
* $class.
765765
*
766766
* This class has been auto-generated
767767
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
1010

1111
/**
12-
* Container
12+
* Container.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
1010

1111
/**
12-
* ProjectServiceContainer
12+
* ProjectServiceContainer.
1313
*
1414
* This class has been auto-generated
1515
* by the Symfony Dependency Injection Component.

src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ public function testFilter()
212212

213213
$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
214214
'flags' => FILTER_FLAG_ALLOW_HEX,
215-
'options' => array('min_range' => 1, 'max_range' => 0xff))
216-
), '->filter() gets a value of parameter as integer between boundaries');
215+
'options' => array('min_range' => 1, 'max_range' => 0xff),
216+
)), '->filter() gets a value of parameter as integer between boundaries');
217217

218218
$this->assertFalse($bag->filter('hex', '', false, FILTER_VALIDATE_INT, array(
219219
'flags' => FILTER_FLAG_ALLOW_HEX,
220-
'options' => array('min_range' => 1, 'max_range' => 0xff))
221-
), '->filter() gets a value of parameter as integer between boundaries');
220+
'options' => array('min_range' => 1, 'max_range' => 0xff),
221+
)), '->filter() gets a value of parameter as integer between boundaries');
222222

223223
$this->assertEquals(array('bang'), $bag->filter('array', '', false), '->filter() gets a value of parameter as an array');
224224
}

src/Symfony/Component/Intl/Tests/Collator/AbstractCollatorTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Intl\Tests\Collator;
1313

1414
use Symfony\Component\Intl\Collator\Collator;
15-
use Symfony\Component\Intl\Locale;
1615

1716
/**
1817
* Test case for Collator implementations.

src/Symfony/Component/Intl/Tests/Collator/Verification/CollatorTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Intl\Tests\Collator\Verification;
1313

14-
use Symfony\Component\Intl\Locale;
1514
use Symfony\Component\Intl\Tests\Collator\AbstractCollatorTest;
1615
use Symfony\Component\Intl\Util\IntlTestHelper;
1716

src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Intl\Tests\NumberFormatter;
1313

1414
use Symfony\Component\Intl\Globals\IntlGlobals;
15-
use Symfony\Component\Intl\Locale;
1615
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
1716
use Symfony\Component\Intl\Util\IntlTestHelper;
1817

src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function dump(array $options = array())
5454
use Symfony\Component\Routing\RequestContext;
5555
5656
/**
57-
* {$options['class']}
57+
* {$options['class']}.
5858
*
5959
* This class has been auto-generated
6060
* by the Symfony Routing Component.

src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Routing\RequestContext;
66

77
/**
8-
* ProjectUrlMatcher
8+
* ProjectUrlMatcher.
99
*
1010
* This class has been auto-generated
1111
* by the Symfony Routing Component.

src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Routing\RequestContext;
66

77
/**
8-
* ProjectUrlMatcher
8+
* ProjectUrlMatcher.
99
*
1010
* This class has been auto-generated
1111
* by the Symfony Routing Component.

src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Symfony\Component\Routing\RequestContext;
66

77
/**
8-
* ProjectUrlMatcher
8+
* ProjectUrlMatcher.
99
*
1010
* This class has been auto-generated
1111
* by the Symfony Routing Component.

src/Symfony/Component/Validator/ConstraintValidator.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface
2424
* Whether to format {@link \DateTime} objects as RFC-3339 dates
2525
* ("Y-m-d H:i:s").
2626
*
27-
* @var integer
27+
* @var int
2828
*/
2929
const PRETTY_DATE = 1;
3030

3131
/**
3232
* Whether to cast objects with a "__toString()" method to strings.
3333
*
34-
* @var integer
34+
* @var int
3535
*/
3636
const OBJECT_TO_STRING = 2;
3737

@@ -81,9 +81,9 @@ protected function formatTypeOf($value)
8181
* won't know what an "object", "array" or "resource" is and will be
8282
* confused by the violation message.
8383
*
84-
* @param mixed $value The value to format as string
85-
* @param integer $format A bitwise combination of the format
86-
* constants in this class
84+
* @param mixed $value The value to format as string
85+
* @param int $format A bitwise combination of the format
86+
* constants in this class
8787
*
8888
* @return string The string representation of the passed value
8989
*/
@@ -141,9 +141,9 @@ protected function formatValue($value, $format = 0)
141141
* Each of the values is converted to a string using
142142
* {@link formatValue()}. The values are then concatenated with commas.
143143
*
144-
* @param array $values A list of values
145-
* @param integer $format A bitwise combination of the format
146-
* constants in this class
144+
* @param array $values A list of values
145+
* @param int $format A bitwise combination of the format
146+
* constants in this class
147147
*
148148
* @return string The string representation of the value list
149149
*

0 commit comments

Comments
 (0)