Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/lib/Drupal/Core/Path/AliasManager.php
Line 107: Unused local variable $original_path
Line 264: Unused local variable $source
Comment | File | Size | Author |
---|---|---|---|
#7 | drupal-remove-unused-var-2062245-7.patch | 1.3 KB | duozersk |
#5 | drupal-remove-unused-var-2062245-5.patch | 1.3 KB | duozersk |
#1 | drupal-remove-unused-var-2062245-1.patch | 705 bytes | duozersk |
Comments
Comment #1
duozerskNot sure if we can somehow fix the $source variable. The patch only fixes the $original_path.
AndyB
Comment #2
andypostSure,
$source
needed here, because could not be defined as used in second part of conditionPS: phpstorm could be wrong, I've filed issue to their tracker WI-19665
Comment #3
alexpottNope phpstorm is not wrong
$source
is always defined again by the second part of the if statement as this will always be executed because the condition is an OR.To be honest I think the code would be more readable if the was this
Comment #4
duozerskWill do.
Comment #5
duozerskComment #7
duozerskYep, I should think more when following the advices ;)
Comment #8
andypostMuch more readable
Comment #9
duozerskComment #10
webchickGreat job!
Committed and pushed to 8.x. Thanks!