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

Variable '$value' is introduced as a method parameter and overridden #1589

Closed
applibs opened this issue Jan 22, 2021 · 1 comment
Closed

Comments

@applibs
Copy link

applibs commented Jan 22, 2021

foreach ($extensions as $key => $value) {
    if ($value['extnId'] == $id) {
        if (!$replace) {
            return false;
        }

        $extensions[$key] = $newext;
        return true;
    }
}
@terrafrost
Copy link
Member

If you're referring to private function setExtensionHelper($id, $value, $critical = false, $replace = true, $path = null) in 3.0 then it's not an issue. The line right before foreach ($extensions as $key => $value) { is as follows:

$newext = ['extnId'  => $id, 'critical' => $critical, 'extnValue' => $value];

ie. the $value method parameter is used to build $newext, at which point, it's no longer needed and is available for reuse, which is what's being done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants