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

[TypeDeclaration] Add class method param type resolving by property #3081

Merged
merged 2 commits into from
Mar 28, 2020

Conversation

TomasVotruba
Copy link
Member

Closes #2887

@TomasVotruba TomasVotruba force-pushed the param-return-by-property branch 5 times, most recently from 9a40653 to 4360401 Compare March 28, 2020 02:31
@TomasVotruba TomasVotruba changed the title [TypeDeclaratoin] Add class method param type resolving by property [TypeDeclaration] Add class method param type resolving by property Mar 28, 2020
@TomasVotruba
Copy link
Member Author

cc @staabm

@TomasVotruba TomasVotruba force-pushed the param-return-by-property branch from 8ff4476 to 0300989 Compare March 28, 2020 02:45
Copy link
Contributor

@staabm staabm left a comment

Choose a reason for hiding this comment

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

Thx for working on it. The test case shows what I expected.

Cannot judge the implementation... not much AST experience on my end

@staabm
Copy link
Contributor

staabm commented Mar 28, 2020

Maybe its a different topic, but I would also add the following example (Same idea but with typed property)

Before

class InferFromPropertyType
 {
     private int $id;

     public function setId($id)
     {
         $this->id = $id;
     }
 }

After

class InferFromPropertyType
 {
     private int $id;

     public function setId(int $id)
     {
         $this->id = $id;
     }
 }

@TomasVotruba
Copy link
Member Author

Thx for working on it. The test case shows what I expected. Cannot judge the implementation... not much AST experience on my end

Thanks, any review and feedback helps me 👍 . I'm blinded by my own ego.

@TomasVotruba
Copy link
Member Author

Maybe its a different topic, but I would also add the following example (Same idea but with typed property)

Good idea, I'll add new type inferer.

@TomasVotruba TomasVotruba force-pushed the param-return-by-property branch from dd89f44 to 6be7a12 Compare March 28, 2020 15:16
@TomasVotruba TomasVotruba force-pushed the param-return-by-property branch from 6be7a12 to 5df24b4 Compare March 28, 2020 15:16
@TomasVotruba TomasVotruba merged commit a89785d into master Mar 28, 2020
@TomasVotruba TomasVotruba deleted the param-return-by-property branch March 28, 2020 15:24
TomasVotruba added a commit that referenced this pull request Nov 19, 2022
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.

infer types of getters/setters from properties
2 participants