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

Add support for phpstan 1.0 #266

Merged
merged 1 commit into from
Nov 8, 2021
Merged

Conversation

alexander-schranz
Copy link
Collaborator

@alexander-schranz alexander-schranz commented Nov 1, 2021

We are using this package in @sulu CMS and as phpstan 1.0 was released I thought it would be great to support the new phpstan version. This PR will set the required phpstan version to 1.0. Would I think be also a good time to tag also this package with 1.0 thats why I did not add it as additional allowed version.

message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\:\\:doubleTheNumber\\(\\)\\.$#"
count: 1
message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\>\\:\\:doubleTheNumber\\(\\)\\.$#"
count: 2
Copy link
Collaborator Author

@alexander-schranz alexander-schranz Nov 1, 2021

Choose a reason for hiding this comment

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

I'm little bit curious why this count did increase. Not sure if I did something wrong in the baseline update, hope you can have a look at it if I did all correctly.
But think aslong as the other file has no error included the plugin works like expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

that's not only a count increase. It shows an modified message too.

Copy link
Collaborator Author

@alexander-schranz alexander-schranz Nov 3, 2021

Choose a reason for hiding this comment

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

The object was changed by me to have 0 errors when using with the extension. Not sure but I think when the run shows 0 errors when extension is enabled and show this errors when extension not enabled we should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

to me, that's fine indeed, based on the change you made.

@@ -62,11 +62,13 @@ public function getTypeFromMethodCall(
return $returnType;
}

if (0 === \count($methodCall->args)) {
$args = $methodCall->getArgs();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alexander-schranz
Copy link
Collaborator Author

alexander-schranz commented Nov 4, 2021

Think @Jan0707 is not longer active on github. @localheinz would be great if you could have a look at this if you maybe got some time for it.

If somebody want to test or use it already add the following to your composer.json:

   "repositories": [
      {
         "type": "vcs":
         "url": "[email protected]:alexander-schranz/phpstan-prophecy.git"
      }
   ],
   ..
   "require-dev": {
       "jangregor/phpstan-prophecy": "dev-patch-1 as 1.0.0"
   }

Copy link
Contributor

@localheinz localheinz left a comment

Choose a reason for hiding this comment

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

👍

@localheinz localheinz merged commit 2bc7ca9 into Jan0707:master Nov 8, 2021
@localheinz
Copy link
Contributor

Thank you, @alexander-schranz and @stof!

@alexander-schranz alexander-schranz deleted the patch-1 branch November 8, 2021 17:07
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