geo icon indicating copy to clipboard operation
geo copied to clipboard

Impossible to declare types for Doctrine entities

Open Kolyunya opened this issue 4 years ago • 3 comments

I was trying to incorporate Doctrine types into my project. Types themselves seem to be working fine. But I came across a problem with type declarations of properties. When I declare property type like this

private Point $point;

I get a error:

The annotation "@noproxy" in method Brick\Geo\Point::geometryType() was never imported. Did you maybe forget to add "use" statement for this annotation?

Moreover this problem persists even if I give up the PHP type declarations and use PHPDoc instead.

So the only option is to remove all type declarations altogether which is obviously a huge issue.

Kolyunya avatar Jan 03 '21 08:01 Kolyunya

Hmm, I'm surprised as last time I checked it was working, moreover Doctrine Annotations should only complain if you use a non-imported annotation in your code, not third-party, AFAIK.

Let me check this on a brand new project and I'll come back to you.

BenMorel avatar Jan 05 '21 18:01 BenMorel

Hi again, sorry for the delay.

I tried to reproduce your issue but failed. Here is a test project you can clone:

https://gist.github.com/BenMorel/d88fb4411a3c0fbd924df7def2d94074

Please see if you can reproduce the issue, or fix it by playing with Doctrine configuration!

BenMorel avatar Feb 08 '21 17:02 BenMorel

@BenMorel thanks for digging into this one. I'm going to make a demo repository.

Kolyunya avatar Feb 11 '21 15:02 Kolyunya