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

Define Proxy as generic #164

Merged
merged 1 commit into from
Apr 5, 2021
Merged

Define Proxy as generic #164

merged 1 commit into from
Apr 5, 2021

Conversation

franmomu
Copy link
Contributor

@franmomu franmomu commented Apr 2, 2021

This would allow things like doctrine/common#926

@greg0ire
Copy link
Member

greg0ire commented Apr 3, 2021

@franmomu maybe this can be improved?

* @psalm-param class-string $className
* @psalm-return class-string

@@ -485,14 +489,21 @@ private function getRealClass(string $class): string
private function createDefaultProxyClassNameResolver(): void
{
$this->proxyClassNameResolver = new class implements ProxyClassNameResolver {
/**
* @template T of object
* @psalm-param class-string<Proxy<T>>|class-string<T> $className
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've copied this because otherwise the /** @psalm-var class-string<T> */ won't recognise the T.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this is not enough, the tests are still failing

Copy link
Contributor Author

@franmomu franmomu Apr 5, 2021

Choose a reason for hiding this comment

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

Apparently it should work, I'll ignore for now.

@greg0ire greg0ire added this to the 2.2.0 milestone Apr 5, 2021
@greg0ire greg0ire merged commit 210e9f5 into doctrine:2.2.x Apr 5, 2021
@greg0ire
Copy link
Member

greg0ire commented Apr 5, 2021

Thanks @franmomu !

@franmomu franmomu deleted the proxy_generic branch April 5, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants