8000 minor #19176 [CS] Respect PSR2 4.2 (phansys) · symfony/symfony@d8dd7f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8dd7f6

Browse files
committed
minor #19176 [CS] Respect PSR2 4.2 (phansys)
This PR was merged into the 2.7 branch. Discussion ---------- [CS] Respect PSR2 4.2 | Q | A | ------------- | --- | Branch | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | http://www.php-fig.org/psr/psr-2/#4-2-properties I'm writing a [new fixer](PHP-CS-Fixer/PHP-CS-Fixer#1889) (`single_class_element_per_statement`), which intends to avoid multiple class elements in one statement. This PR is a POC about the result of this fixer, so I'd like to know what do you think about, since it will be also added to the `@Symfony` ruleset. Please note that class constants are considered too, but here isn't any offending code about that. Example output: ``` $ ./php-cs-fixer.phar fix . --rules=single_class_element_per_statement -vvv 1) src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php (single_class_element_per_statement) 2) src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php (single_class_element_per_statement) 3) src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php (single_class_element_per_statement) 4) src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php (single_class_element_per_statement) ``` Commits ------- d250b1d [CS] Respect PSR2 4.2
2 parents fad545a + d250b1d commit d8dd7f6

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
class ProxyManagerBridgeFooClass
44
{
5-
public $foo, $moo;
6-
7-
public $bar = null, $initialized = false, $configured = false, $called = false, $arguments = array();
5+
public $foo;
6+
public $moo;
7+
8+
public $bar = null;
9+
public $initialized = false;
10+
public $configured = false;
11+
public $called = false;
12+
public $arguments = array();
813

914
public function __construct($arguments = array())
1015
{

src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
1919
{
2020
protected static $fixtures;
2121

22-
protected $foo, $bar, $foo1, $foo2;
22+
protected $foo;
23+
protected $bar;
24+
protected $foo1;
25+
protected $foo2;
2326

2427
public static function setUpBeforeClass()
2528
{

src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,9 @@ public function testAlias()
599599

600600
class ProjectServiceContainer extends Container
601601
{
602-
public $__bar, $__foo_bar, $__foo_baz;
602+
public $__bar;
603+
public $__foo_bar;
604+
public $__foo_baz;
603605
public $synchronized;
604606

605607
public function __construct()

src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44

55
class FooClass
66
{
7-
public $foo, $moo;
8-
9-
public $bar = null, $initialized = false, $configured = false, $called = false, $arguments = array();
7+
public $foo;
8+
public $moo;
9+
10+
public $bar = null;
11+
public $initialized = false;
12+
public $configured = false;
13+
public $called = false;
14+
public $arguments = array();
1015

1116
public function __construct($arguments = array())
1217
{

0 commit comments

Comments
 (0)
0