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

Adds generics annotations #104

Merged
merged 1 commit into from
May 12, 2020
Merged

Adds generics annotations #104

merged 1 commit into from
May 12, 2020

Conversation

weph
Copy link
Contributor

@weph weph commented May 1, 2020

Not sure if that's enough to close #72 but it's a start ;)

@Ocramius
Copy link
Member

Ocramius commented May 1, 2020 via email

@weph
Copy link
Contributor Author

weph commented May 1, 2020

Yeah, wasn't sure about that. It's a list in doctrine/orm, but doctrine/mongodb-odm uses the document id as array key. Not sure about the other odm implementations. I agree that it should be a list, though. Overriding the annotations in odm doesn't seem right but that's just my humble opinion.

@greg0ire
Copy link
Member

greg0ire commented May 1, 2020

Nice PR! You gave me the motivation to setup Psalm on this lib! See #105

@weph
Copy link
Contributor Author

weph commented May 4, 2020

Do you have any opinions on this one, @alcaeus ?

@alcaeus
Copy link
Member

alcaeus commented May 12, 2020

Do you have any opinions on this one, @alcaeus ?

Sorry for the delay. Since ODM doesn't return a list but rather a struct, this has to be T[] for the time being.

@alcaeus
Copy link
Member

alcaeus commented May 12, 2020

Note that this should go into 1.4.x since that version is supposed to have feature parity with 2.0.

@weph could you please change the target branch and rebase? Thanks!

@greg0ire
Copy link
Member

Psalm support just landed on 1.4.x BTW :)

@greg0ire greg0ire changed the base branch from master to 1.4.x May 12, 2020 16:54
@greg0ire
Copy link
Member

I did the rebase for you.

@greg0ire greg0ire closed this May 12, 2020
@greg0ire greg0ire reopened this May 12, 2020
@greg0ire
Copy link
Member

Reopening to get a report from Travis

@greg0ire greg0ire merged commit 2b28bb9 into doctrine:1.4.x May 12, 2020
@greg0ire
Copy link
Member

Thanks @weph !

@weph
Copy link
Contributor Author

weph commented May 13, 2020

Thank you, @greg0ire !

@@ -111,9 +115,9 @@ public function flush();
/**
* Gets the repository for a class.
*
* @param string $className
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line should be preserved to allow IDE know about required argument type.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Do you mind creating a pull request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Here it is #111

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.

Add support for generics via static analysis
5 participants