Skip to content
Permalink
Browse files

Prohibit mutation-free assignment ops

  • Loading branch information...
muglug committed Sep 3, 2019
1 parent da23c2e commit 8601731fa2f4a926549e6118a550903436fef171
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
@@ -736,10 +736,10 @@ public static function analyzeAssignmentOperation(
$statements_analyzer
);
if ($array_var_id && $context->pure && strpos($array_var_id, '->')) {
if ($array_var_id && $context->mutation_free && strpos($array_var_id, '->')) {
if (IssueBuffer::accepts(
new ImpurePropertyAssignment(
'Cannot assign to a property from a pure context',
'Cannot assign to a property from a mutation-free context',
new CodeLocation($statements_analyzer, $stmt->var)
),
$statements_analyzer->getSuppressedIssues()

0 comments on commit 8601731

Please sign in to comment.
You can’t perform that action at this time.