auraphp / Aura.Di

Dependency Injection System
MIT License
349 stars 63 forks source link

property-read designation causes PHPStorm to have syntax error #91

Closed brandonsavage closed 9 years ago

brandonsavage commented 9 years ago

PHPStorm 9 reports that the @property-read designation on the DI properties (params, etc) to be a syntax error.

pmjones commented 9 years ago

Is this an issue with Aura.Di, or with PHPStorm 9? My understanding is that earlier versions of PHPStorm recognized it.

brandonsavage commented 9 years ago

If the property designation is wrong (since it's actually NOT a read-only property) it's an error with Aura.Di.

On Wed, Jul 15, 2015 at 12:17 PM, Paul M. Jones notifications@github.com wrote:

Is this an issue with Aura.Di, or with PHPStorm 9? My understanding is that earlier versions of PHPStorm recognized it.

— Reply to this email directly or view it on GitHub https://github.com/auraphp/Aura.Di/issues/91#issuecomment-121666205.

pmjones commented 9 years ago

Gotcha. PRs welcome on this one, since I don't use PHPStorm and thus can't test it.

silentworks commented 9 years ago

@brandonsavage I am using PHPStorm 9, I don't have this issue at all, so it might just be that you need to invalidate your cache and restart PHPStorm.

brandonsavage commented 9 years ago

That doesn't solve the issue. I think Aura.Di 3.x doesn't use the setting.

On Wed, Jul 29, 2015 at 6:52 PM, Andrew Smith notifications@github.com wrote:

@brandonsavage https://github.com/brandonsavage I am using PHPStorm 9, I don't have this issue at all, so it might just be that you need to invalidate your cache and restart PHPStorm.

— Reply to this email directly or view it on GitHub https://github.com/auraphp/Aura.Di/issues/91#issuecomment-126119976.

pmjones commented 9 years ago

@brandonsavage If you can submit a PR that fixes the issue, I'll be happy to review it.

brandonsavage commented 9 years ago

Done.

On Sat, Aug 1, 2015 at 2:57 PM, Paul M. Jones notifications@github.com wrote:

@brandonsavage https://github.com/brandonsavage If you can submit a PR that fixes the issue, I'll be happy to review it.

— Reply to this email directly or view it on GitHub https://github.com/auraphp/Aura.Di/issues/91#issuecomment-126945147.

harikt commented 9 years ago

Hi @brandonsavage ,

Is this issue for 2.x or 3.x? From your comment https://github.com/auraphp/Aura.Di/issues/91#issuecomment-126123160 it seems the issue with 3.x as @silentworks doesn't face the same. And PR #93 is on 2.x branch when I checked to merge.

Thank you.

silentworks commented 9 years ago

This is for 3.x, I have now noticed the issue too. Sorry I should have clarified that I am also using 3.x.

brandonsavage commented 9 years ago

My patch is for 2.x, though I'm sure it can be ported and applied to 3.x. I'm using 2.x

On Wed, Aug 5, 2015 at 5:40 AM, Andrew Smith notifications@github.com wrote:

This is for 3.x, I have now noticed the issue too. Sorry I should have clarified that I am also using 3.x.

— Reply to this email directly or view it on GitHub https://github.com/auraphp/Aura.Di/issues/91#issuecomment-127935756.

pmjones commented 9 years ago

I've opened the 2.x Container file in PHPStorm 9.0.1, and I don't notice it reporting a syntax error. Am I missing something?

screen shot 2015-08-17 at 01 08 41

silentworks commented 9 years ago

There is no issue by opening the file directly, but if you try to set $container->types[''] that is where the issue is, as in the docblocks of the class it states it is a read only property although in the Aura.Di documentation it states you can write to it.

I think these properties should be actual methods in Container rather than using the magical __get to set them.

Also note, this is the same in the 3.x branch, I am currently just ignoring the error even though it exists.

Screenshot of error example below:

screenshot 2015-08-17 08 57 18
pmjones commented 9 years ago

if you try to set $container->types[''] that is where the issue is

Gotcha.

I think these properties should be actual methods in Container rather than using the magical __get to set them.

Let me see what I can do.