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
Alter removes a reference variable, breaking the code after #6114
Labels
Comments
I found these snippets: https://psalm.dev/r/7e011cd6cc<?php
class A {
/** @var array */
private $transformationInfo = [];
function foo(): void {
global $cfgRelation;
$this->transformationInfo[$cfgRelation['db']] = [];
$relDb = &$this->transformationInfo[$cfgRelation['db']];
if (! empty($cfgRelation['history'])) {
$relDb[$cfgRelation['history']] = ['sqlquery' => $sqlHighlightingData];
}
if (! empty($cfgRelation['bookmark'])) {
$relDb[$cfgRelation['bookmark']] = ['query' => $sqlHighlightingData];
}
}
}
|
Psalm already prevent emitting UnusedVariable on references. After #6129, it will also do that for globals. I think it'd also need to do it for variables that are references of others. |
I believe this is now fixed, likely by #7339. I tested by:
And
And the line is not changed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/7e011cd6cc
Source: https://github.com/phpmyadmin/phpmyadmin/blob/1835ebb4fccc20aa06868be88ab8bcaa9c395ccf/libraries/classes/Display/Results.php#L333
It removes the assignment (
$relDb = &
), but if you do that the code below will not work.Same here:
The text was updated successfully, but these errors were encountered: