Skip to content

Fixing method updating when return type is nullable.#2779

Merged
dantleech merged 2 commits intophpactor:masterfrom
mamazu:phpactor-2778
Nov 16, 2024
Merged

Fixing method updating when return type is nullable.#2779
dantleech merged 2 commits intophpactor:masterfrom
mamazu:phpactor-2778

Conversation

@mamazu
Copy link
Copy Markdown
Contributor

@mamazu mamazu commented Nov 16, 2024

Replaces #2778

When updating a method's return type the TextEdit updates only the type list which is correct unless there is a nullable token at the beginning:

public function test() ?Testing;
                        ^     ^

This is the part that was being replaced. This PR will also include the question mark operator.

@mamazu mamazu force-pushed the phpactor-2778 branch 3 times, most recently from 82dcb65 to f4d3d7d Compare November 16, 2024 18:22
@mamazu mamazu changed the title Fixing method updating when return type is empty. Fixing method updating when return type is nullable. Nov 16, 2024
Comment on lines +223 to +225
if ($returnType === '') {
return;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we also want to remove the return type when phpactor renders it as empty?

@dantleech dantleech merged commit cb871c4 into phpactor:master Nov 16, 2024
@dantleech
Copy link
Copy Markdown
Collaborator

🙇

@mamazu mamazu deleted the phpactor-2778 branch November 16, 2024 21:25
@jeremyFreeAgent
Copy link
Copy Markdown

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants