-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Add more statements for NewlineAfterStatementRector (#792)
* [CodingStyle] Add more statements for NewlineAfterStatementRector * cs fix
- Loading branch information
1 parent
ec7c68f
commit 170a09f
Showing
4 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...CodingStyle/Rector/Stmt/NewlineAfterStatementRector/Fixture/no_new_line_classlike.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace A | ||
{ | ||
class C | ||
{ | ||
} | ||
class D | ||
{ | ||
} | ||
} | ||
namespace B | ||
{ | ||
interface E | ||
{ | ||
} | ||
trait F | ||
{ | ||
} | ||
class G implements E | ||
{ | ||
use F; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace A | ||
{ | ||
class C | ||
{ | ||
} | ||
|
||
class D | ||
{ | ||
} | ||
} | ||
|
||
namespace B | ||
{ | ||
interface E | ||
{ | ||
} | ||
|
||
trait F | ||
{ | ||
} | ||
|
||
class G implements E | ||
{ | ||
use F; | ||
} | ||
} | ||
|
||
?> |
32 changes: 32 additions & 0 deletions
32
...CodingStyle/Rector/Stmt/NewlineAfterStatementRector/Fixture/no_new_line_try_catch.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Stmt\NewlineAfterStatementRector\Fixture; | ||
|
||
function run() | ||
{ | ||
try { | ||
|
||
} catch (Exception $e) { | ||
|
||
} | ||
return true; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Stmt\NewlineAfterStatementRector\Fixture; | ||
|
||
function run() | ||
{ | ||
try { | ||
|
||
} catch (Exception $e) { | ||
|
||
} | ||
|
||
return true; | ||
} | ||
|
||
?> |
36 changes: 36 additions & 0 deletions
36
...odingStyle/Rector/Stmt/NewlineAfterStatementRector/Fixture/no_new_line_try_switch.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Stmt\NewlineAfterStatementRector\Fixture; | ||
|
||
function run($data) | ||
{ | ||
switch ($data) { | ||
case 'a': | ||
echo 'test'; | ||
break; | ||
default: | ||
echo 'test 1'; | ||
} | ||
return true; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Stmt\NewlineAfterStatementRector\Fixture; | ||
|
||
function run($data) | ||
{ | ||
switch ($data) { | ||
case 'a': | ||
echo 'test'; | ||
break; | ||
default: | ||
echo 'test 1'; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters