From: Derick Alangi Date: Wed, 27 Mar 2019 11:35:40 +0000 (+0100) Subject: debug: Use __CLASS__ to get the name of the class X-Git-Tag: 1.34.0-rc.0~2117^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=bca4196e7d8915cd12619f84602b07365d9c1a5c;p=lhc%2Fweb%2Fwiklou.git debug: Use __CLASS__ to get the name of the class self::class would have been better here for consistency across the code base but seems HHVM handles self::class diferrently from PHP 7, when used inside a trait. The difference is significant to the tests and thus we keep the result the same by using __CLASS__ instead. Change-Id: I58b452341a0567f4d6e6636a7e489531a5569d20 --- diff --git a/includes/debug/DeprecationHelper.php b/includes/debug/DeprecationHelper.php index cd78005a65..91ad67ec16 100644 --- a/includes/debug/DeprecationHelper.php +++ b/includes/debug/DeprecationHelper.php @@ -68,7 +68,7 @@ trait DeprecationHelper { protected function deprecatePublicProperty( $property, $version, $class = null, $component = null ) { - $this->deprecatedPublicProperties[$property] = [ $version, $class ?: get_class(), $component ]; + $this->deprecatedPublicProperties[$property] = [ $version, $class ?: __CLASS__, $component ]; } public function __get( $name ) { @@ -79,7 +79,7 @@ trait DeprecationHelper { return $this->$name; } - $qualifiedName = get_class() . '::$' . $name; + $qualifiedName = __CLASS__ . '::$' . $name; if ( $this->deprecationHelperGetPropertyOwner( $name ) ) { // Someone tried to access a normal non-public property. Try to behave like PHP would. trigger_error( "Cannot access non-public property $qualifiedName", E_USER_ERROR ); @@ -99,7 +99,7 @@ trait DeprecationHelper { return; } - $qualifiedName = get_class() . '::$' . $name; + $qualifiedName = __CLASS__ . '::$' . $name; if ( $this->deprecationHelperGetPropertyOwner( $name ) ) { // Someone tried to access a normal non-public property. Try to behave like PHP would. trigger_error( "Cannot access non-public property $qualifiedName", E_USER_ERROR );