-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed constant types handling in TypedPropertyFromStrictConstructorRe…
…ctor (#4588) * Fixed constant-literal handling in TypedPropertyFromStrictConstructorRector * fix * add analog test to TypedPropertyFromStrictConstructorReadonlyClassRector
- Loading branch information
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...tyFromStrictConstructorReadonlyClassRector/Fixture/skip_literal_incompatible_type.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorReadonlyClassRector\Fixture; | ||
|
||
final class SkipLiteralIncompatibleType | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $due_date; | ||
|
||
public function __construct() | ||
{ | ||
$this->due_date = true; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...PropertyFromStrictConstructorReadonlyClassRector/Fixture/skip_literal_string_type.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorReadonlyClassRector\Fixture; | ||
|
||
final class SkipLiteralStringType | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $due_date; | ||
|
||
public function __construct() | ||
{ | ||
$this->due_date = ''; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...y/TypedPropertyFromStrictConstructorRector/Fixture/skip_literal_incompatible_type.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
final class SkipLiteralIncompatibleType | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $due_date; | ||
|
||
public function __construct() | ||
{ | ||
$this->due_date = true; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...roperty/TypedPropertyFromStrictConstructorRector/Fixture/skip_literal_string_type.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
final class SkipLiteralStringType | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $due_date; | ||
|
||
public function __construct() | ||
{ | ||
$this->due_date = ''; | ||
} | ||
} |
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