From 5dd6e3f8f17ef6230e85c974fe8f188ee5014d86 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 3 Mar 2023 10:34:10 +1300 Subject: [PATCH] MNT Remove old deprecation warnings --- src/Control/HTTPApplication.php | 50 +++++++++------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/src/Control/HTTPApplication.php b/src/Control/HTTPApplication.php index d6be9abf6..b5bbd142f 100644 --- a/src/Control/HTTPApplication.php +++ b/src/Control/HTTPApplication.php @@ -6,15 +6,12 @@ use SilverStripe\Control\Middleware\HTTPMiddlewareAware; use SilverStripe\Core\Application; use SilverStripe\Core\Environment; use SilverStripe\Core\Kernel; -use SilverStripe\Core\Manifest\Module; use SilverStripe\Core\Startup\FlushDiscoverer; use SilverStripe\Core\Startup\CompositeFlushDiscoverer; use SilverStripe\Core\Startup\CallbackFlushDiscoverer; use SilverStripe\Core\Startup\RequestFlushDiscoverer; use SilverStripe\Core\Startup\ScheduledFlushDiscoverer; use SilverStripe\Core\Startup\DeployFlushDiscoverer; -use SilverStripe\Dev\Deprecation; -use SilverStripe\GraphQL\TypeCreator; class HTTPApplication implements Application { @@ -152,41 +149,22 @@ class HTTPApplication implements Application * * Don't remove this method even if it's just a no-op - we'll reuse this mechanism * in the future as needed. + * + * Example of use going from CMS 4 to CMS 5: + * + * // TypeCreator is a class unique to GraphQL v3 - we use it in other areas to detect + * // which version is being used. + * if (class_exists(TypeCreator::class)) { + * Deprecation::notice( + * '4.13.0', + * 'silverstripe/graphql 3.x is deprecated. Upgrade to 4.x instead.' + * . ' See https://docs.silverstripe.org/en/4/upgrading/upgrading_to_graphql_4/', + * Deprecation::SCOPE_GLOBAL + * ); + * } */ private function warnAboutDeprecatedSetups() { - // TypeCreator is a class unique to GraphQL v3 - we use it in other areas to detect - // which version is being used. - if (class_exists(TypeCreator::class)) { - Deprecation::notice( - '4.13.0', - 'silverstripe/graphql 3.x is deprecated. Upgrade to 4.x instead.' - . ' See https://docs.silverstripe.org/en/4/upgrading/upgrading_to_graphql_4/', - Deprecation::SCOPE_GLOBAL - ); - } - - // The alternate_public_dir config property is deprecated, but because it's - // always fetched it'll throw a deprecation warning whether you've set it or not. - // There are also multiple mechanisms which can result in this bad configuration. - if (PUBLIC_DIR !== 'public' || Director::publicDir() !== PUBLIC_DIR) { - Deprecation::notice( - '4.13.0', - 'Use of a public webroot other than "public" is deprecated.' - . ' See https://docs.silverstripe.org/en/4/changelogs/4.1.0#public-folder/', - Deprecation::SCOPE_GLOBAL - ); - } - - // This change of defaults has no other deprecation notice being emitted currently. - $project = new Module(BASE_PATH, BASE_PATH); - if ($project->getResourcesDir() === '') { - Deprecation::notice( - '4.13.0', - 'The RESOURCES_DIR constant will change to "_resources" by default.' - . ' See https://docs.silverstripe.org/en/5/changelogs/5.0.0/#api-general', - Deprecation::SCOPE_GLOBAL - ); - } + // noop } }