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

Quick mock fails when using the new "public readonly" notation for Constructor Property Promotion #90

Open
MollocH opened this issue Sep 26, 2022 · 1 comment

Comments

@MollocH
Copy link

MollocH commented Sep 26, 2022

Describe the bug
In PHP8, constructor property promotion was introduced. On top of that we can now define visibility and immutability of a property.

Example:

public function __construct(
        private readonly EventLogInterface $eventLogService,
        private readonly FileUploadRepository $fileUploadRepository
) {
}

Quick mock will create these annotations:

/** @var private|ObjectProphecy */
private $eventLogService;
/** @var private|ObjectProphecy */
private $fileUploadRepository;
@henneboele
Copy link

Not sure if it is only for readonly property promotion.
It also messed up the code when using property promotion like

public function __construct(
        private EventLogInterface $eventLogService,
        private FileUploadRepository $fileUploadRepository
) {
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants