-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php80] Copy PhpDocInfo values on ClassPropertyAssignToConstructorPro…
…motionRector (#744) * Add failing test fixture for ClassPropertyAssignToConstructorPromotionRector # Failing Test for ClassPropertyAssignToConstructorPromotionRector Based on https://getrector.org/demo/1ec03dbd-591c-689e-b45c-6563b6259c57 * Update y.php.inc * update fixture * Closes #743 * phpstan * move to PhpDocTypeChanger Co-authored-by: Jáchym Toušek <enumag@gmail.com>
- Loading branch information
1 parent
241f8a9
commit 7eb5e75
Showing
3 changed files
with
84 additions
and
1 deletion.
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
57 changes: 57 additions & 0 deletions
57
...80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector/Fixture/copy_doc.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,57 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
use Symfony\Component\Validator\Constraints as Assert; | ||
|
||
class Y {} | ||
class Z {} | ||
|
||
final class CopyDoc | ||
{ | ||
public Y $y; | ||
|
||
/** | ||
* @var Z[] | ||
* @Assert\Valid() | ||
* @Assert\NotBlank() | ||
*/ | ||
public array $z = []; | ||
|
||
/** | ||
* @param Z[] $z | ||
*/ | ||
public function __construct(Y $y, array $z = []) | ||
{ | ||
$this->y = $y; | ||
$this->z = $z; | ||
} | ||
} | ||
?> | ||
----- | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
use Symfony\Component\Validator\Constraints as Assert; | ||
|
||
class Y {} | ||
class Z {} | ||
|
||
final class CopyDoc | ||
{ | ||
/** | ||
* @param Z[] $z | ||
*/ | ||
public function __construct( | ||
public Y $y, | ||
/** | ||
* @Assert\Valid() | ||
* @Assert\NotBlank() | ||
*/ | ||
public array $z = [] | ||
) | ||
{ | ||
} | ||
} | ||
?> |
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