Skip to content

Generics + better doc types PHPStan/psalm #138

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

Merged
merged 4 commits into from
Apr 26, 2020
Merged

Generics + better doc types PHPStan/psalm #138

merged 4 commits into from
Apr 26, 2020

Conversation

marc-mabe
Copy link
Owner

@marc-mabe marc-mabe commented Dec 20, 2019

  • Introduces static code analyzes with PHPStan and psalm
  • added generics using doc types for EnumSet and EnumMap
  • Better doc types

@marc-mabe marc-mabe force-pushed the doc-generics branch 4 times, most recently from 1c8f566 to 5914b16 Compare January 11, 2020 12:36
@marc-mabe
Copy link
Owner Author

@prolic Hi - please could you take a look on this and share your opinions?

@prolic
Copy link
Collaborator

prolic commented Jan 16, 2020 via email

@marc-mabe
Copy link
Owner Author

marc-mabe commented Jan 16, 2020 via email

Copy link
Collaborator

@prolic prolic left a comment

Choose a reason for hiding this comment

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

Looks good. Any points I should check more in depth?

@marc-mabe
Copy link
Owner Author

Thanks for reviewing @prolic 👍
I would like to get your opinion about IDE support as currently such Syntax is not natively supported by any of the IDEs I know. Means PHPStan gets better results but it reduces developer experience like autocompletion.

@prolic
Copy link
Collaborator

prolic commented Feb 12, 2020 via email

@prolic
Copy link
Collaborator

prolic commented Apr 3, 2020

@marc-mabe What's the status here?

@marc-mabe
Copy link
Owner Author

marc-mabe commented Apr 4, 2020

The problem is this this breaks IDEs. I was hoping that at least some IDEs start to support it but it didn't until now.

As a workaround all the annotations needs to be prefixed.

Additionally I want to test this with psalm as well but didn't have time.

PS: my private time reduced drastically with the crises ... @prolic Would you like to be added as a collaborator?

@prolic
Copy link
Collaborator

prolic commented Apr 4, 2020

@marc-mabe I maintain already at least 15 open source projects, one more doesn't make a difference at this point, lol. Sure, go ahead and add me.

@marc-mabe
Copy link
Owner Author

@prolic I have added you.

I have no idea where you get the time and energy to work on so many OS projects. You are my hero ;)

@marc-mabe marc-mabe added this to the 4.3.0 milestone Apr 5, 2020
@marc-mabe
Copy link
Owner Author

Encountered a problem on how PHPStan interprets psalm type list<non-empty-string>.
Reported as bug here phpstan/phpstan#3148

@marc-mabe marc-mabe marked this pull request as ready for review April 26, 2020 12:54
@marc-mabe marc-mabe changed the title Generics via PHPStan Generics + better doc types PHPStan/psalm Apr 26, 2020
@marc-mabe marc-mabe merged commit fba3870 into master Apr 26, 2020
@marc-mabe marc-mabe deleted the doc-generics branch April 27, 2020 09:54
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.

2 participants