-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add some tests with current object
- Loading branch information
1 parent
4a3c957
commit d052ec1
Showing
3 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...ts/CodingStyle/Rector/ClassMethod/NewlineBeforeNewAssignSetRector/Fixture/objects.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,38 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector\Fixture; | ||
|
||
final class Objects | ||
{ | ||
private ?Value $foo = null; | ||
private ?Value $bar = null; | ||
public function run() | ||
{ | ||
$this->foo = new Value; | ||
$this->foo->bar = 1; | ||
$this->bar = new Value; | ||
$this->bar->bar = 1; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector\Fixture; | ||
|
||
final class Objects | ||
{ | ||
private ?Value $foo = null; | ||
private ?Value $bar = null; | ||
public function run() | ||
{ | ||
$this->foo = new Value; | ||
$this->foo->bar = 1; | ||
|
||
$this->bar = new Value; | ||
$this->bar->bar = 1; | ||
} | ||
} | ||
|
||
?> |
38 changes: 38 additions & 0 deletions
38
...ts/CodingStyle/Rector/ClassMethod/NewlineBeforeNewAssignSetRector/Fixture/statics.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,38 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector\Fixture; | ||
|
||
final class Statics | ||
{ | ||
protected static ?Value $fooBar = null; | ||
protected static ?Value $barFoo = null; | ||
public function run() | ||
{ | ||
self::$fooBar = new Value; | ||
self::$fooBar->bar = 1; | ||
self::$barFoo = new Value; | ||
self::$barFoo->bar = 1; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector\Fixture; | ||
|
||
final class Objects | ||
{ | ||
protected static ?Value $fooBar = null; | ||
protected static ?Value $barFoo = null; | ||
public function run() | ||
{ | ||
self::$fooBar = new Value; | ||
self::$fooBar->bar = 1; | ||
|
||
self::$barFoo = new Value; | ||
self::$barFoo->bar = 1; | ||
} | ||
} | ||
|
||
?> |
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