-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fn() => __FUNCTION__ and __METHOD__
- Loading branch information
1 parent
a06d509
commit 58ebacf
Showing
5 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/PHPStan/Rules/Functions/data/bug-anonymous-function-method-constant.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php declare(strict_types = 1); // lint >= 7.4 | ||
|
||
namespace BugAnonymousFunctionMethodConstant; | ||
|
||
$a = fn() => __FUNCTION__; | ||
$b = fn() => __METHOD__; | ||
|
||
$c = function() { return __FUNCTION__; }; | ||
$d = function() { return __METHOD__; }; | ||
|
||
\PHPStan\Testing\assertType("'{closure}'", $a()); | ||
\PHPStan\Testing\assertType("'{closure}'", $b()); | ||
\PHPStan\Testing\assertType("'{closure}'", $c()); | ||
\PHPStan\Testing\assertType("'{closure}'", $d()); |