In core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php, testGet() is initializing two variables that aren't used.
$arguments = isset($values['arguments']) ? $values['arguments'] : [];
$options = isset($values['context']) ? [
'context' => $values['context'],
] : [];
Those variables need to be removed.
| Comment | File | Size | Author |
|---|---|---|---|
| unsused-variable-removed.patch | 774 bytes | hardik_patel_12 |
Comments
Comment #2
siddhant.bhosale commentedComment #3
siddhant.bhosale commentedComment #4
avpadernoTo push this patch, we need to check if it's just a matter of initialized variables that aren't used or there is missing code that needs to be restored.
We need to check in which commit those variables were introduced and which commit removed the code using those variables, if such commit has been done.
Comment #5
paulocsI found the issue that removed the code that used to use the variables, but I'm not sure if we should re-add what was removed or just remove the unused variables.
The code bellow was removed in issue #2557113: Make t() return a TranslationWrapper object to remove reliance on a static, unpredictable safe list:
Comment #6
avpadernoComment #7
avpaderno@paulocs Good catch!
Given that the current code is the following one, it's the variables that need to be removed, not the code to be added.
$valuesis already passed to the constructor of theTranslationclass. There is no need to extract$argumentsand>$optionsfrom$values.Comment #8
avpadernoThe patch is removing the unused variables, which is the correct thing to do.
Comment #10
catchCommitted 703dbe1 and pushed to 9.1.x. Thanks!