-
-
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.
[Php81] Skip override __construct from interface on NewInInitializerR…
…ector (#1913) Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
c149cb4
commit dbdcaa1
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
.../Rector/ClassMethod/NewInInitializerRector/Fixture/skip_override_interface_method.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassMethod\NewInInitializerRector\Fixture; | ||
|
||
use DateTime; | ||
use Rector\Tests\Php81\Rector\ClassMethod\NewInInitializerRector\Source\OverrideInterfaceMethod; | ||
|
||
class SkipOverrideInterfaceMethod implements OverrideInterfaceMethod | ||
{ | ||
private DateTime $dateTime; | ||
|
||
public function __construct( | ||
?DateTime $dateTime = null | ||
) { | ||
$this->dateTime = $dateTime ?? new DateTime('now'); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...-tests/Php81/Rector/ClassMethod/NewInInitializerRector/Source/OverrideInterfaceMethod.php
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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassMethod\NewInInitializerRector\Source; | ||
|
||
use DateTime; | ||
|
||
interface OverrideInterfaceMethod | ||
{ | ||
public function __construct( | ||
?DateTime $dateTime = null | ||
); | ||
} |