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

Upgrade phpstan to v0.12.9 #121

Merged
merged 14 commits into from
Feb 11, 2020
Merged

Upgrade phpstan to v0.12.9 #121

merged 14 commits into from
Feb 11, 2020

Conversation

Xint0-elab
Copy link
Contributor

@Xint0-elab Xint0-elab commented Feb 6, 2020

  • Added or updated tests
  • Added or updated the README.md
  • Detailed changes in the CHANGELOG.md unreleased section

Related Issue/Intent

Fixes #122 (Support v0.12 of PHPStan)

Changes

Now EnumMethodReflection implements the following methods:

  • getDeprecatedDescription - Will return the @deprecated tag description of the generating constant.
  • getDocComment - Will return null.
  • getThrowType - Will return null.
  • hasSideEffects - Will return TrinaryLogic::No.
  • isDeprecated - Will return the isDeprecated value of the generating constant.
  • isFinal - Will return TrinaryLogic::No.
  • isInternal - Will return the isInternal value of the generating constant.

Breaking changes

Should not break any functionality.

For testing support for @internal and @deprecated PHPDoc tags.
Previous to v0.12 of PHPStan, there were multiple optional reflection
interfaces that were not implemented in EnumMethodReflection. Now the
methods from those interfaces were integrated to the MethodReflection
interface.  The new tests verify the methods return expected values.

The isInternal, isDeprecated, and getDeprecatedDescription return value
will be inherited from the constant that defines the static method.
In PHPStan v0.12 multiple optional reflection interfaces were integrated
into MethodReflection interface. EnumMethodReflection now implements:

- getDeprecatedDescription() - Will return the @deprecated tag
  description of the generating constant.
- getDocComment - Will return null as this is a dynamic method.
- getThrowType - Will return null.
- hasSideEffects - Will return TrinaryLogic::No.
- isDeprecated - Will return the value of isDeprecated of the generating
  constant.
- isFinal - Will return TrinaryLogic::No.
- isInternal - Will return the value of isInternal of the generating
  constant.
PHPStan v0.12 changed the FunctionVariant constructor signature.
FunctionVariant constructor now requires two new parameters
templateTypeMap and resolvedTemplateTypeMap. Will default to empty
TemplateTypeMap and null respectively.
@Xint0-elab Xint0-elab mentioned this pull request Feb 8, 2020
@BenSampo
Copy link
Owner

BenSampo commented Feb 9, 2020

@spawnia I don't use PHPStan. Would you give me some feedback on this PR? Does #119 supersede this?

@spawnia
Copy link
Collaborator

spawnia commented Feb 10, 2020

This does basically the same thing as #119. However, i like the additional tests and some cases that i did not have in mind were considered.

@Xint0-elab can you rebase your PR on top of the latest changes in master so we can converge on the optimal solution?

@Xint0-elab
Copy link
Contributor Author

@spawnia Sure thing

For testing support for @internal and @deprecated PHPDoc tags.
Previous to v0.12 of PHPStan, there were multiple optional reflection
interfaces that were not implemented in EnumMethodReflection. Now the
methods from those interfaces were integrated to the MethodReflection
interface.  The new tests verify the methods return expected values.

The isInternal, isDeprecated, and getDeprecatedDescription return value
will be inherited from the constant that defines the static method.
In PHPStan v0.12 multiple optional reflection interfaces were integrated
into MethodReflection interface. EnumMethodReflection now implements:

- getDeprecatedDescription() - Will return the @deprecated tag
  description of the generating constant.
- getDocComment - Will return null as this is a dynamic method.
- getThrowType - Will return null.
- hasSideEffects - Will return TrinaryLogic::No.
- isDeprecated - Will return the value of isDeprecated of the generating
  constant.
- isFinal - Will return TrinaryLogic::No.
- isInternal - Will return the value of isInternal of the generating
  constant.
PHPStan v0.12 changed the FunctionVariant constructor signature.
@BenSampo
Copy link
Owner

Thanks @Xint0-elab 👍

@BenSampo BenSampo merged commit 7a175aa into BenSampo:master Feb 11, 2020
@spawnia
Copy link
Collaborator

spawnia commented Feb 11, 2020

Awesome, one more step in making the PHP world a (type-)safer place :)

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.

PHPStan v0.12 error
3 participants