Skip to content

Implement @pure-unless-callable-impure #3482

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Draft
wants to merge 7 commits into
base: 2.0.x
Choose a base branch
from

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Sep 25, 2024

This PR is still a work in progress, no tests or rules have been added yet.

  • Add tests
  • Add rules
  • Add function map

refs #3106, phpstan/phpstan#11100 and phpstan/phpstan#11710

related issue phpstan/phpdoc-parser#253

@zonuexezonuexe marked this pull request as draft September 25, 2024 17:46
public function resolveParamPureUnlessCallableIsImpure(PhpDocNode $phpDocNode): array
{
$parameters = [];
// TODO: implement phpstan/phpdoc-parser
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be replaced by phpstan/phpdoc-parser#253

@@ -22,6 +22,7 @@ public function __construct(
private ?Type $outType,
private TrinaryLogic $immediatelyInvokedCallable,
private ?Type $closureThisType,
private bool $pureUnlessCallableIsImpureParameter = false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

WIP. = false will be removed.

@ondrejmirtes
Copy link
Member

Just updated phpdoc-parser here so you can use that.

@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch 4 times, most recently from eddd22a to f207c72 Compare September 30, 2024 18:09
@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch from f207c72 to 8c756cc Compare November 3, 2024 17:57
@staabm
Copy link
Contributor

@zonuexe any plans to move this forward?

@zonuexe
Copy link
Contributor Author

@staabm Hi, I know this branch is important but it was blocked due to my motivation. I'm going to rebase it on 2.0.x and do the necessary work. If I miss it tonight, I won't be able to start the rest of the work until next week, so it would be quicker for you to take over then.

@staabm
Copy link
Contributor

I don't want to put pressure on you. It was not clear to me whether you stopped working on it or not.

I am totally fine if this takes a bit more time - thank you

@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch from 8c756cc to 389c7f0 Compare November 19, 2024 16:58
@zonuexe
Copy link
Contributor Author

No problem, this is a very interesting subject for me too, so I'm happy to work on it because I realized that there are other people who are interested in it. More importantly, I'm always helped by your hard work.

@zonuexezonuexe changed the base branch from 1.12.x to 2.0.x November 19, 2024 17:11
@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch 2 times, most recently from c89f485 to b0d5146 Compare November 19, 2024 18:11
@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch from b0d5146 to 2146ae0 Compare November 19, 2024 18:16
@zonuexezonuexe force-pushed the feature/pure-unless-callable-is-impure branch from 2146ae0 to 1cc1fad Compare November 19, 2024 18:32
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants