From 76012b00f9d6c34b2fd4d9847cd9b1f41c528c92 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 16 Nov 2022 11:59:27 +1300 Subject: [PATCH] API Update deprecations --- src/Console/VendorExposeCommand.php | 4 +++- src/Library.php | 2 +- src/VendorModule.php | 8 ++++++-- src/VendorPlugin.php | 8 +++++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Console/VendorExposeCommand.php b/src/Console/VendorExposeCommand.php index 46aedf5..fff4347 100644 --- a/src/Console/VendorExposeCommand.php +++ b/src/Console/VendorExposeCommand.php @@ -2,6 +2,7 @@ namespace SilverStripe\VendorPlugin\Console; +use SilverStripe\Dev\Deprecation; use Composer\Command\BaseCommand; use Composer\Factory; use Composer\IO\ConsoleIO; @@ -92,11 +93,12 @@ protected function getAllLibraries() /** * Find all modules * - * @deprecated 1.3..2.0 + * @deprecated 1.3.0 Use getAllLibraries() instead * @return Library[] */ protected function getAllModules() { + Deprecation::notice('1.3.0', 'Use getAllLibraries() instead'); return $this->getAllLibraries(); } diff --git a/src/Library.php b/src/Library.php index 9e00fa9..e1f585f 100644 --- a/src/Library.php +++ b/src/Library.php @@ -26,7 +26,7 @@ class Library /** * Subfolder to map within public webroot - * @deprecated 1.4.0..2.0.0 Use Library::getResourcesDir() instead + * @deprecated 1.4.0 Use Library::getResourcesDir() instead */ const RESOURCES_PATH = self::DEFAULT_RESOURCES_DIR; diff --git a/src/VendorModule.php b/src/VendorModule.php index 628ea12..e100570 100644 --- a/src/VendorModule.php +++ b/src/VendorModule.php @@ -2,10 +2,12 @@ namespace SilverStripe\VendorPlugin; +use SilverStripe\Dev\Deprecation; + /** * Represents a module in the vendor folder * - * @deprecated 1.3..2.0 Use Library instead + * @deprecated 1.3.0 Use Library instead */ class VendorModule extends Library { @@ -27,6 +29,7 @@ class VendorModule extends Library */ public function __construct($basePath, $name) { + Deprecation::notice('1.3.0', 'Use Library instead', Deprecation::SCOPE_CLASS); $path = Util::joinPaths( $basePath, static::DEFAULT_SOURCE, @@ -38,12 +41,13 @@ public function __construct($basePath, $name) /** * Get full path to the root install for this project * - * @deprecated 1.3..2.0 use getPath() instead + * @deprecated 1.3.0 Use getPath() instead * @param string $base Rewrite root (or 'vendor' for actual module path) * @return string Path for this module */ public function getModulePath($base = self::DEFAULT_SOURCE) { + Deprecation::notice('1.3.0', 'Use getPath() instead'); if ($base === self::DEFAULT_TARGET) { return $this->getPublicPath(); } else { diff --git a/src/VendorPlugin.php b/src/VendorPlugin.php index e67b27b..715087e 100644 --- a/src/VendorPlugin.php +++ b/src/VendorPlugin.php @@ -2,6 +2,7 @@ namespace SilverStripe\VendorPlugin; +use SilverStripe\Dev\Deprecation; use Composer\Composer; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UninstallOperation; @@ -26,14 +27,14 @@ class VendorPlugin implements PluginInterface, EventSubscriberInterface, Capable /** * Default module type * - * @deprecated 1.3..2.0 No longer used + * @deprecated 1.3.0 Will be removed without equivalent functionality to replace it */ const MODULE_TYPE = 'silverstripe-vendormodule'; /** * Filter for matching library types to expose * - * @deprecated 1.3..2.0 No longer used + * @deprecated 1.3.0 Will be removed without equivalent functionality to replace it */ const MODULE_FILTER = '/^silverstripe\-(\w+)$/'; @@ -96,12 +97,13 @@ public static function getSubscribedEvents() /** * Get vendor module instance for this event * - * @deprecated 1.3..2.0 + * @deprecated 1.3.0 Use getLibrary() instead * @param PackageEvent $event * @return Library|null */ protected function getVendorModule(PackageEvent $event) { + Deprecation::notice('1.3.0', 'Use getLibrary() instead'); return $this->getLibrary($event); }