Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Update deprecations #62

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Console/VendorExposeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SilverStripe\VendorPlugin\Console;

use SilverStripe\Dev\Deprecation;
use Composer\Command\BaseCommand;
use Composer\Factory;
use Composer\IO\ConsoleIO;
Expand Down Expand Up @@ -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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Framework isn't a dependency of this library. We could use raw PHP deprecation notice I guess?

return $this->getAllLibraries();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 6 additions & 2 deletions src/VendorModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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,
Expand All @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions src/VendorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SilverStripe\VendorPlugin;

use SilverStripe\Dev\Deprecation;
use Composer\Composer;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
Expand All @@ -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+)$/';

Expand Down Expand Up @@ -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);
}

Expand Down