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

Fix Call to an undefined method user() #254

Merged
merged 5 commits into from
Aug 15, 2019
Merged

Fix Call to an undefined method user() #254

merged 5 commits into from
Aug 15, 2019

Conversation

UksusoFF
Copy link
Contributor

@UksusoFF UksusoFF commented Mar 7, 2019

Fixes #44

@szepeviktor szepeviktor changed the title Fixed https://github.com/nunomaduro/larastan/issues/44 Fixed Call to an undefined method user() Mar 7, 2019
@szepeviktor szepeviktor changed the title Fixed Call to an undefined method user() Fix Call to an undefined method user() Mar 7, 2019
@szepeviktor
Copy link
Collaborator

Very nice.
Thank you.

Please fix this little thing

diff --git a/src/ReturnTypes/Helpers/AuthExtension.php b/src/ReturnTypes/Helpers/AuthExtension.php
index f8cbcf74f183607b36ce1b131b1fcb74b4c6a1c0..b7294079a13eec842457a63f3e8e2c615bc813ab 100644
--- a/src/ReturnTypes/Helpers/AuthExtension.php
+++ b/src/ReturnTypes/Helpers/AuthExtension.php
@@ -13,12 +13,12 @@ declare(strict_types=1);
 
 namespace NunoMaduro\Larastan\ReturnTypes\Helpers;
 
-use PhpParser\Node\Expr\FuncCall;
+use PHPStan\Type\Type;
 use PHPStan\Analyser\Scope;
+use PHPStan\Type\ObjectType;
+use PhpParser\Node\Expr\FuncCall;
 use PHPStan\Reflection\FunctionReflection;
 use PHPStan\Type\DynamicFunctionReturnTypeExtension;
-use PHPStan\Type\ObjectType;
-use PHPStan\Type\Type;
 
 /**
  * @internal

@nunomaduro
Copy link
Collaborator

Would be cool, if you could add a test on this.

@UksusoFF
Copy link
Contributor Author

UksusoFF commented Mar 7, 2019

As I can see we have trouble with Lumen. How we can fix this if there is no Auth in Lumen?

@szepeviktor
Copy link
Collaborator

You may help me find a Lumen specialist #244

@UksusoFF
Copy link
Contributor Author

UksusoFF commented Mar 11, 2019

@nunomaduro @szepeviktor Seems like this is old trouble. So maybe can merge without Lumen support?

@szepeviktor
Copy link
Collaborator

@nunomaduro Is it OK for you?

@UksusoFF
Copy link
Contributor Author

@szepeviktor I dig it deeper and found that we have same troubles as #71 with auth()->check() and other guard magic calls :(

@nunomaduro nunomaduro merged commit edcf75c into larastan:master Aug 15, 2019
@nunomaduro
Copy link
Collaborator

It's fine to just cover partially some of the auth calls for now, let's merge it. And add the support to check() and other guard magic calls later.

@Okipa
Copy link

Okipa commented Aug 26, 2019

It seems that this issue is still breaking since this has been released : #44 (comment)

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.

Call to an undefined method user()
4 participants