Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have made a class that extends SearchApiSolrConnection. In this class I override some methods to suit my needs. I also overrides some of the constants, and that's a bit of a problem cause, quiet a few of the methods uses self instead of $this, so I have to copy and paste those methods into my class too, with seems stupid.
What if, we changed the self to $this in the SearchApiSolrConnection class? Would it make any difference or impact on other functionality?
Comments
Comment #1
drunken monkeyThanks for suggesting this!
However, do you know whether using
$this
in this manner is compatible with PHP 5.2? I know that the (equivalent)static
keyword (resp. its use in this context) wasn't introduced until 5.3 or 5.4.Otherwise, I'd say this would be a good idea which we could of course implement, yes.
Comment #2
tlyngej CreditAttribution: tlyngej commentedAfter some quick tests I found out, that Views depends totally breaks, if changing the
self
to$this
. And, as you mention, there might be a problem with older versions of PHP.So maybe we can re-consider this for the Drupal 8 version, if Views behaves more nicely. But, for now, I think of this issue as not possible.