8000 minor #25653 PHP CS Fixer: clean up repo and adjust config (keradus) · sroze/symfony@0f884e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f884e0

Browse files
minor symfony#25653 PHP CS Fixer: clean up repo and adjust config (keradus)
This PR was squashed before being merged into the 2.7 branch (closes symfony#25653). Discussion ---------- PHP CS Fixer: clean up repo and adjust config | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | n/a | Fixed tickets | n/a | License | MIT | Doc PR | n/a Reason for this PR is that one want to have `php-cs-fixer fix -v` command executed without changes that shall not be applied for this repo. To achieve that, we need to groom config to exclude files that violate CS willingly, fix files that are violating CS unwillingly, and deliver missing case handling at PHP CS Fixer itself (PHP-CS-Fixer/PHP-CS-Fixer#3359) (already merged!). Commits ------- b14cbc1 PHP CS Fixer: clean up repo and adjust config
2 parents 8e54591 + b14cbc1 commit 0f884e0

File tree

16 files changed

+66
-19
lines changed

16 files changed

+66
-19
lines changed

.php_cs.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ return PhpCsFixer\Config::create()
1212
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice
1313
'array_syntax' => array('syntax' => 'long'),
1414
'protected_to_private' => false,
15+
// rule disabled due to https://bugs.php.net/bug.php?id=60573 bug;
16+
// to be re-enabled (by dropping next line, rule is part of @Symfony already) on branch that requires PHP 5.4+
17+
'self_accessor' => false,
1518
))
1619
->setRiskyAllowed(true)
1720
->setFinder(
@@ -34,5 +37,9 @@ return PhpCsFixer\Config::create()
3437
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
3538
// explicit heredoc test
3639
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
40+
// explicit trigger_error tests
41+
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt')
42+
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt')
43+
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
3744
)
3845
;

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,35 @@ public function getTransTests()
8989
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
9090

9191
// transchoice
92-
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
93-
'There is no apples', array('count' => 0)),
94-
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
95-
'There is 5 apples', array('count' => 5)),
96-
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
97-
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
98-
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
99-
'There is 5 apples (Symfony)', array('count' => 5)),
100-
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
101-
'There is no apples', array('count' => 0)),
102-
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
103-
'There is 5 apples'),
92+
array(
93+
'{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
94+
'There is no apples',
95+
array('count' => 0),
96+
),
97+
array(
98+
'{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
99+
'There is 5 apples',
100+
array('count' => 5),
101+
),
102+
array(
103+
'{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
104+
'There is 5 apples (Symfony)',
105+
array('count' => 5, 'name' => 'Symfony'),
106+
),
107+
array(
108+
'{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
109+
'There is 5 apples (Symfony)',
110+
array('count' => 5),
111+
),
112+
array(
113+
'{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
114+
'There is no apples',
115+
array('count' => 0),
116+
),
117+
array(
118+
'{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
119+
'There is 5 apples',
120+
),
104121

105122
// trans filter
106123
array('{{ "Hello"|trans }}', 'Hello'),

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class Translator extends BaseTranslator implements WarmableInterface
4646
private $resources = array();
4747

4848
/**
49+
* Constructor.
50+
*
4951
* Available options:
5052
*
5153
* * cache_dir: The cache directory (or null to disable caching)

src/Symfony/Component/Debug/Resources/ext/tests/001.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
--TEST--
22
Test symfony_zval_info API
33
--SKIPIF--
4-
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
4+
<?php if (!extension_loaded('symfony_debug')) {
5+
echo 'skip';
6+
} ?>
57
--FILE--
68
<?php
79

src/Symfony/Component/Debug/Resources/ext/tests/002.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
--TEST--
22
Test symfony_debug_backtrace in case of fatal error
33
--SKIPIF--
4-
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
4+
<?php if (!extension_loaded('symfony_debug')) {
5+
echo 'skip';
6+
} ?>
57
--FILE--
68
<?php
79

src/Symfony/Component/Debug/Resources/ext/tests/002_1.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
--TEST--
22
Test symfony_debug_backtrace in case of non fatal error
33
--SKIPIF--
4-
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
4+
<?php if (!extension_loaded('symfony_debug')) {
5+
echo 'skip';
6+
} ?>
57
--FILE--
68
<?php
79

src/Symfony/Component/Debug/Resources/ext/tests/003.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
--TEST--
22
Test ErrorHandler in case of fatal error
< EF5E /code>
33
--SKIPIF--
4-
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
4+
<?php if (!extension_loaded('symfony_debug')) {
5+
echo 'skip';
6+
} ?>
57
--FILE--
68
<?php
79

src/Symfony/Component/Debug/Tests/phpt/exception_rethrown.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ ErrorHandler::register()->setDefaultLogger(new TestLogger());
2626
ini_set('display_errors', 1);
2727

2828
throw new \Exception('foo');
29-
3029
?>
3130
--EXPECTF--
3231
Uncaught Exception: foo

src/Symfony/Component/Debug/Tests/phpt/fatal_with_nested_handlers.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ var_dump(array(
2424
$eHandler[0]->setExceptionHandler('print_r');
2525

2626
if (true) {
27-
class Broken implements \Serializable {};
27+
class Broken implements \Serializable
28+
{
29+
}
2830
}
2931

3032
?>

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php

Lines changed: 2 additions & 0 deletions
< 43BA td data-grid-cell-id="diff-b89fd81da1e829e39c2dbf222cc723d771b0c60655e0a8de2b5f1b8cc05c58b4-57-59-2" data-line-anchor="diff-b89fd81da1e829e39c2dbf222cc723d771b0c60655e0a8de2b5f1b8cc05c58b4R59" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell left-side">
* List of available options:
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface
5454
private $timeCol;
5555

5656
/**
57+
* Constructor.
58+
*
5759
5860
* * db_table: The name of the table [required]
5961
* * db_id_col: The column where to store the session id [default: sess_id]

0 commit comments

Comments
 (0)
0