collation: Use `self` to reference same class instead of class name
authorDerick Alangi <alangiderick@gmail.com>
Wed, 20 Mar 2019 20:00:03 +0000 (21:00 +0100)
committerDerick Alangi <alangiderick@gmail.com>
Wed, 20 Mar 2019 20:00:03 +0000 (21:00 +0100)
With the use of `self`, even if the class name is changed (which is
very unlikely), then the code won't break. So it's a way of future
proofing the code.

Change-Id: Ib4046315b8aaee2e77af036893924962d25ceeb1

includes/collation/Collation.php

index ab3c6fb..312c2d4 100644 (file)
@@ -76,7 +76,7 @@ abstract class Collation {
                                $collationObject = null;
                                Hooks::run( 'Collation::factory', [ $collationName, &$collationObject ] );
 
-                               if ( $collationObject instanceof Collation ) {
+                               if ( $collationObject instanceof self ) {
                                        return $collationObject;
                                }