Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Hardik_Patel_12 created an issue. See original summary.

Hardik_Patel_12’s picture

Kindly review a patch.

Hardik_Patel_12’s picture

Assigned: Hardik_Patel_12 » Unassigned
Status: Active » Needs review
snehalgaikwad’s picture

Status: Needs review » Reviewed & tested by the community

I've tried this patch. Looking good to me. Unused variables are removed.

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/media/src/OEmbed/UrlResolver.php
@@ -123,7 +123,7 @@ protected function findUrl(\DOMXPath $xpath, $format) {
     // Check the URL against every scheme of every endpoint of every provider
     // until we find a match.
-    foreach ($this->providers->getAll() as $provider_name => $provider_info) {
+    foreach ($this->providers->getAll() as $provider_info) {
       foreach ($provider_info->getEndpoints() as $endpoint) {

People often specify the key regardless of usage in foreach statements for readability. Please remove that hunk from the patch and let's open a coding standards issue if we want to standardise either way.

Rangaswini’s picture

Assigned: Unassigned » Rangaswini
Rangaswini’s picture

@Hardik_Patel_12 and @catch
Updated the patch as per the standards.

Hardik_Patel_12’s picture

Assigned: Rangaswini » Unassigned
Status: Needs work » Needs review
Rangaswini’s picture

Assigned: Unassigned » Rangaswini
Issue summary: View changes
Status: Needs review » Needs work
FileSize
758 bytes
758 bytes

@Hardik_Patel_12 and @catch
Updated the patch as per the standards.

Rangaswini’s picture

Rangaswini’s picture

Assigned: Rangaswini » Unassigned
Status: Needs work » Needs review
hash6’s picture

Assigned: Unassigned » hash6
hash6’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @Rangaswini for the patch, I have reviewed the above patch and we can definitely remove the unused variable ,also confirmed it in the community with @longwave as well :)

hash6’s picture

Assigned: hash6 » Unassigned
catch’s picture

Version: 9.0.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 3459966 and pushed to 9.0.x. Thanks!

  • catch committed cd07900 on 9.0.x
    Issue #3107006 by Rangaswini, Hardik_Patel_12, hash6: Remove unused...

  • catch committed 1c23653 on 8.9.x
    Issue #3107006 by Rangaswini, Hardik_Patel_12, hash6: Remove unused...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.