Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jul 25, 2024
1 parent 2846b29 commit 6358029
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public function start(
PhpParser\Node\FunctionLike $stmt,
bool $fake_method = false,
PhpParser\Comment\Doc $doc_comment = null
)
{
) {
if ($stmt instanceof PhpParser\Node\Expr\Closure
|| $stmt instanceof PhpParser\Node\Expr\ArrowFunction
) {
Expand Down
12 changes: 9 additions & 3 deletions src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@

namespace Psalm\Plugin\EventHandler\Event;

use PhpParser\Node\ArrayItem;
use PhpParser\Node\Expr;
use Psalm\Codebase;
use Psalm\Context;
use Psalm\StatementsSource;

final class AddRemoveTaintsEvent
{
private Expr $expr;
/** @var ArrayItem|Expr */
private $expr;
private Context $context;
private StatementsSource $statements_source;
private Codebase $codebase;

/**
* Called after an expression has been checked
*
* @param ArrayItem|Expr $expr
* @internal
*/
public function __construct(
Expr $expr,
$expr,
Context $context,
StatementsSource $statements_source,
Codebase $codebase
Expand All @@ -31,7 +34,10 @@ public function __construct(
$this->codebase = $codebase;
}

public function getExpr(): Expr
/**
* @return ArrayItem|Expr
*/
public function getExpr()
{
return $this->expr;
}
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/SuicidalAutoloader/autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'PHPUnit\Framework\DOMElement',
'Stringable',
'AllowDynamicProperties',
'PhpParser\Node\Stmt\Throw', // BCHelper for nikic/php-parser v4/5

// https://github.com/symfony/symfony/pull/40203
// these are actually functions, referenced as `if (!function_exists(u::class))`
Expand Down

0 comments on commit 6358029

Please sign in to comment.