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 already constant #2885

Merged
merged 2 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.6-dev"
"dev-master": "0.8-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,13 @@ private function refactorClassMethod(ClassMethod $classMethod, Class_ $class, ar
foreach ($readOnlyVariableAssigns as $readOnlyVariableAssign) {
$this->removeNode($readOnlyVariableAssign);

/** @var Variable $variable */
/** @var Variable|ClassConstFetch $variable */
$variable = $readOnlyVariableAssign->var;
// already overriden
if (! $variable instanceof Variable) {
continue;
}

$classConst = $this->createClassConst($variable, $readOnlyVariableAssign->expr);

// replace $variable usage in the code with constant
Expand Down