diff --git a/src/Core/Extensible.php b/src/Core/Extensible.php index 95782feee30..98163ba7067 100644 --- a/src/Core/Extensible.php +++ b/src/Core/Extensible.php @@ -511,7 +511,7 @@ public function getExtensionInstances() // Setup all extension instances for this instance $this->extension_instances = []; foreach (ClassInfo::ancestry(static::class) as $class) { - if (in_array($class, self::$unextendable_classes)) { + if (in_array($class, self::class::$unextendable_classes)) { continue; } $extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES); diff --git a/src/Dev/Deprecation.php b/src/Dev/Deprecation.php index e8d1111a431..05050c4f193 100644 --- a/src/Dev/Deprecation.php +++ b/src/Dev/Deprecation.php @@ -391,7 +391,7 @@ public static function notice($atVersion, $string = '', $scope = Deprecation::SC } // Getting a backtrace is slow, so we only do it if we need it - $backtrace = null; + $backtrace = []; // Get the calling scope if ($scope == Deprecation::SCOPE_METHOD) { diff --git a/tests/php/Dev/DeprecationTest.php b/tests/php/Dev/DeprecationTest.php index 03f0154fd48..811e2ca70b6 100644 --- a/tests/php/Dev/DeprecationTest.php +++ b/tests/php/Dev/DeprecationTest.php @@ -111,8 +111,8 @@ public function testNoticeNoReplacement() 'Will be removed without equivalent functionality to replace it.', 'Called from SilverStripe\Dev\Tests\DeprecationTest->testNoticeNoReplacement.' ]); - $this->expectDeprecation(); - $this->expectDeprecationMessage($message); + $this->expectException(DeprecationTestException::class); + $this->expectExceptionMessage($message); $this->enableDeprecationNotices(true); $ret = $this->myDeprecatedMethodNoReplacement(); $this->assertSame('abc', $ret);