-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Carbon] Add immutable support to other rules (#5896)
- Loading branch information
1 parent
1fd156b
commit fe31e19
Showing
3 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...tests/Carbon/Rector/MethodCall/DateTimeMethodCallToCarbonRector/Fixture/immutable.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Carbon\Rector\MethodCall\DateTimeMethodCallToCarbonRector\Fixture; | ||
|
||
final class Immutable | ||
{ | ||
public function run() | ||
{ | ||
$date = (new \DateTimeImmutable('today +20 day'))->format('Y-m-d'); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Carbon\Rector\MethodCall\DateTimeMethodCallToCarbonRector\Fixture; | ||
|
||
final class Immutable | ||
{ | ||
public function run() | ||
{ | ||
$date = (\Carbon\CarbonImmutable::today()->addDays(20))->format('Y-m-d'); | ||
} | ||
} | ||
|
||
?> |
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
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