I'm trying to replace the Geocoder service by a new one extending it to remove the call to drupal_set_message() in log() method.

Problem is that calls to this method are done using self::log($e->getMessage(), 'error');, so when using the child service, the function called is Geocoder::log() instead of SilentGeocoder::log().

My proposal is to replace those calls with static::log($e->getMessage(), 'error'); to allow inheritence.

PHPdoc reference: http://php.net/manual/en/language.oop5.late-static-bindings.php

CommentFileSizeAuthor
#2 replace_self_with-2745781-2.patch946 bytesplopesc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plopesc created an issue. See original summary.

plopesc’s picture

Title: Replae "self" with "static" in Geocoder Service to allow inheritance » Replace "self" with "static" in Geocoder Service to allow inheritance
Status: Active » Needs review
FileSize
946 bytes

Attaching patch.

Thanks

  • Pol committed a199127 on 8.x-2.x authored by plopesc
    Issue #2745781 by plopesc: Replace "self" with "static" in Geocoder...
Pol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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