-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php80] Fix add default nullable type on ClassPropertyAssignToConstru…
…ctorPromotionRector (#4091)
- Loading branch information
1 parent
c567d5d
commit ff21394
Showing
14 changed files
with
283 additions
and
20 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
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
28 changes: 28 additions & 0 deletions
28
.../Class_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_false.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultFalse | ||
{ | ||
public $name; | ||
|
||
public function __construct(string $name = false) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultFalse | ||
{ | ||
public function __construct(public string|false $name = false) | ||
{ | ||
} | ||
} | ||
|
||
?> |
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
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_nullable2.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable2 | ||
{ | ||
public $name; | ||
|
||
public function __construct(string|false $name = null) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable2 | ||
{ | ||
public function __construct(public string|false|null $name = null) | ||
{ | ||
} | ||
} | ||
|
||
?> |
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_nullable3.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable3 | ||
{ | ||
public $name; | ||
|
||
public function __construct(object|false $name = null) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable3 | ||
{ | ||
public function __construct(public object|false|null $name = null) | ||
{ | ||
} | ||
} | ||
|
||
?> |
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_nullable4.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable4 | ||
{ | ||
public $name; | ||
|
||
public function __construct(array|false $name = null) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable4 | ||
{ | ||
public function __construct(public array|false|null $name = null) | ||
{ | ||
} | ||
} | ||
|
||
?> |
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_nullable5.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable5 | ||
{ | ||
public $name; | ||
|
||
public function __construct(iterable|false $name = null) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable5 | ||
{ | ||
public function __construct(public iterable|false|null $name = null) | ||
{ | ||
} | ||
} | ||
|
||
?> |
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/add_default_nullable6.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable6 | ||
{ | ||
public $name; | ||
|
||
public function __construct(self|false $name = null) | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class AddDefaultNullable6 | ||
{ | ||
public function __construct(public \Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture\AddDefaultNullable6|false|null $name = null) | ||
{ | ||
} | ||
} | ||
|
||
?> |
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
28 changes: 28 additions & 0 deletions
28
...ss_/ClassPropertyAssignToConstructorPromotionRector/Fixture/string_default_string.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,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class StringDefaultString | ||
{ | ||
public $name; | ||
|
||
public function __construct(string $name = '') | ||
{ | ||
$this->name = $name; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class StringDefaultString | ||
{ | ||
public function __construct(public string $name = '') | ||
{ | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.