diff --git a/composer.json b/composer.json index e7a3b27..4ab94a1 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,6 @@ "psr/simple-cache": "^3.0.0" }, "require-dev": { - "silverstripe/framework": "^5", "phpunit/phpunit": "^9.5", "mikey179/vfsstream": "^1.6", "squizlabs/php_codesniffer": "^3.7" @@ -21,4 +20,4 @@ "SilverStripe\\Config\\Tests\\": "tests/" } } -} \ No newline at end of file +} diff --git a/src/Collections/MemoryConfigCollection.php b/src/Collections/MemoryConfigCollection.php index 5963a5c..b87af73 100644 --- a/src/Collections/MemoryConfigCollection.php +++ b/src/Collections/MemoryConfigCollection.php @@ -117,7 +117,11 @@ public function checkForDeprecatedConfig($class, $name): void $deprecated = $this->getClassConfig('__deprecated', true); $data = $deprecated['config'][strtolower($class)][$name] ?? []; if (!empty($data)) { - Deprecation::notice($data['version'], $data['message'], Deprecation::SCOPE_CONFIG); + if (class_exists(Deprecation::class)) { + Deprecation::notice($data['version'], $data['message'], Deprecation::SCOPE_CONFIG); + } else { + user_error($data['message'], E_USER_DEPRECATED); + } } }