Skip to content

[type-declaration] Add typed property, if traits do not duplicate the property#6663

Merged
TomasVotruba merged 2 commits intomainfrom
tv-allow-trait
Jan 9, 2025
Merged

[type-declaration] Add typed property, if traits do not duplicate the property#6663
TomasVotruba merged 2 commits intomainfrom
tv-allow-trait

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jan 9, 2025

No description provided.

@TomasVotruba TomasVotruba changed the title tv allow trait [type-declaration] Add typed property, if traits do not duplicate the property Jan 9, 2025
@TomasVotruba TomasVotruba merged commit 8da1bfe into main Jan 9, 2025
@TomasVotruba TomasVotruba deleted the tv-allow-trait branch January 9, 2025 20:26
return (bool) $this->betterNodeFinder->findFirst(
$trait,
function (Node $node) use ($propertyName): bool {
if (! $node instanceof Assign) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should cover assign op, eg $this->props .= "append"; as well, using attribute key is_being_assigned should be more reliable.

public function isLeftPartOfAssign(Node $node): bool

Also needs to verify if property is being unset() via trait.

, i will check it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants