Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behavior of ClassPropertyAssignToConstructorPromotionRector #8438

Closed
staabm opened this issue Jan 29, 2024 · 0 comments · Fixed by rectorphp/rector-src#5603
Closed
Labels

Comments

@staabm
Copy link
Contributor

staabm commented Jan 29, 2024

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

more precise php-doc - in this case positive-int - is lost while transformation

Minimal PHP Code Causing Issue

See https://getrector.com/demo/a37c4a63-360f-4d0a-b1f0-42eb2885841a

<?php
namespace Fare\ArticleExport\Viewmodel;
/**
 * @immutable
 */
final class PreisStufeVM
{
    /** @var positive-int */
    public int $mengeab;

    public float $price;

    public function __construct(int $mengeab, float $price)
    {
        $this->mengeab = $mengeab;
        $this->price = $price;
    }
}

Responsible rules

  • ClassPropertyAssignToConstructorPromotionRector

Expected Behavior

@staabm staabm added the bug label Jan 29, 2024
TomasVotruba added a commit that referenced this issue Feb 11, 2024
rectorphp/rector-src@df8d2b7 Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#8438) (#5603)
TomasVotruba added a commit that referenced this issue Feb 11, 2024
rectorphp/rector-src@df8d2b7 Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#8438) (#5603)
TomasVotruba added a commit that referenced this issue Feb 11, 2024
rectorphp/rector-src@df8d2b7 Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#8438) (#5603)
TomasVotruba added a commit that referenced this issue Feb 11, 2024
rectorphp/rector-src@df8d2b7 Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#8438) (#5603)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant