From ece90030bff5cd2665e0f9dbba024643f9a3e439 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 25 Oct 2022 18:00:47 +1300 Subject: [PATCH] API Update deprecations (#375) * ENH Update deprecation messages * API Update deprecations * API Update deprecation message --- .../DataObjectScaffolderExtension.php | 8 ++++- .../GraphQL/Extensions/DeleteExtension.php | 8 ++++- .../GraphQL/Extensions/ManagerExtension.php | 8 ++++- _legacy/GraphQL/Extensions/ReadExtension.php | 8 ++++- .../Extensions/SchemaScaffolderExtension.php | 8 ++++- _legacy/GraphQL/Operations/CopyToStage.php | 4 ++- _legacy/GraphQL/Operations/Publish.php | 11 +++++- .../GraphQL/Operations/PublishOperation.php | 4 ++- _legacy/GraphQL/Operations/ReadVersions.php | 4 ++- _legacy/GraphQL/Operations/Rollback.php | 4 ++- _legacy/GraphQL/Operations/Unpublish.php | 11 +++++- .../GraphQL/Resolvers/ApplyVersionFilters.php | 8 ++++- .../GraphQL/Types/CopyToStageInputType.php | 10 +++++- _legacy/GraphQL/Types/VersionSortType.php | 10 +++++- _legacy/GraphQL/Types/VersionedInputType.php | 10 +++++- _legacy/GraphQL/Types/VersionedQueryMode.php | 10 +++++- _legacy/GraphQL/Types/VersionedStage.php | 10 +++++- _legacy/GraphQL/Types/VersionedStatus.php | 10 +++++- src/Dev/VersionedTestSessionExtension.php | 8 ++++- src/Versioned.php | 36 ++++++++++--------- 20 files changed, 155 insertions(+), 35 deletions(-) diff --git a/_legacy/GraphQL/Extensions/DataObjectScaffolderExtension.php b/_legacy/GraphQL/Extensions/DataObjectScaffolderExtension.php index 1b1d47eb..bed85b9c 100644 --- a/_legacy/GraphQL/Extensions/DataObjectScaffolderExtension.php +++ b/_legacy/GraphQL/Extensions/DataObjectScaffolderExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Extensions; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use SilverStripe\Core\Extension; @@ -19,7 +20,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class DataObjectScaffolderExtension extends Extension { @@ -27,6 +28,11 @@ class DataObjectScaffolderExtension extends Extension * Adds the "Version" and "Versions" fields to any dataobject that has the Versioned extension. * @param Manager $manager */ + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function onBeforeAddToManager(Manager $manager) { /* @var DataObjectScaffolder $owner */ diff --git a/_legacy/GraphQL/Extensions/DeleteExtension.php b/_legacy/GraphQL/Extensions/DeleteExtension.php index 6dc53d08..a4a18408 100644 --- a/_legacy/GraphQL/Extensions/DeleteExtension.php +++ b/_legacy/GraphQL/Extensions/DeleteExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Extensions; +use SilverStripe\Dev\Deprecation; use Exception; use SilverStripe\Core\Extension; use SilverStripe\GraphQL\Scaffolding\Scaffolders\CRUD\Delete; @@ -18,7 +19,7 @@ /** * Extends the @see Delete CRUD scaffolder to unpublish any items first * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class DeleteExtension extends Extension { @@ -30,6 +31,11 @@ class DeleteExtension extends Extension * @param array $context * @throws Exception */ + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function augmentMutation(DataList $objects, $args, $context) { foreach ($objects as $object) { diff --git a/_legacy/GraphQL/Extensions/ManagerExtension.php b/_legacy/GraphQL/Extensions/ManagerExtension.php index 48874fc7..37995219 100644 --- a/_legacy/GraphQL/Extensions/ManagerExtension.php +++ b/_legacy/GraphQL/Extensions/ManagerExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Extensions; +use SilverStripe\Dev\Deprecation; use SilverStripe\Core\Extension; use SilverStripe\Versioned\GraphQL\Types\CopyToStageInputType; use SilverStripe\Versioned\GraphQL\Types\VersionedInputType; @@ -17,7 +18,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class ManagerExtension extends Extension { @@ -26,6 +27,11 @@ class ManagerExtension extends Extension * * @param $config */ + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function updateConfig(&$config) { if (!isset($config['types'])) { diff --git a/_legacy/GraphQL/Extensions/ReadExtension.php b/_legacy/GraphQL/Extensions/ReadExtension.php index 5e008efc..1c4d7fa5 100644 --- a/_legacy/GraphQL/Extensions/ReadExtension.php +++ b/_legacy/GraphQL/Extensions/ReadExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Extensions; +use SilverStripe\Dev\Deprecation; use SilverStripe\Core\Extension; use SilverStripe\Core\Injector\Injector; use SilverStripe\GraphQL\Resolvers\ApplyVersionFilters; @@ -21,10 +22,15 @@ * Decorator for either a Read or ReadOne query scaffolder * * @property Read|ReadOne $owner - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class ReadExtension extends Extension { + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function updateList(DataList &$list, $args) { if (!isset($args[$this->argName()])) { diff --git a/_legacy/GraphQL/Extensions/SchemaScaffolderExtension.php b/_legacy/GraphQL/Extensions/SchemaScaffolderExtension.php index 2ba90a51..5e9879db 100644 --- a/_legacy/GraphQL/Extensions/SchemaScaffolderExtension.php +++ b/_legacy/GraphQL/Extensions/SchemaScaffolderExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Extensions; +use SilverStripe\Dev\Deprecation; use SilverStripe\Core\Extension; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Scaffolding\Scaffolders\SchemaScaffolder; @@ -16,7 +17,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class SchemaScaffolderExtension extends Extension { @@ -26,6 +27,11 @@ class SchemaScaffolderExtension extends Extension * * @param Manager $manager */ + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function onBeforeAddToManager(Manager $manager) { $memberType = StaticSchema::inst()->typeNameForDataObject(Member::class); diff --git a/_legacy/GraphQL/Operations/CopyToStage.php b/_legacy/GraphQL/Operations/CopyToStage.php index 10aeb56a..5b4279ee 100644 --- a/_legacy/GraphQL/Operations/CopyToStage.php +++ b/_legacy/GraphQL/Operations/CopyToStage.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\Type; use InvalidArgumentException; @@ -24,7 +25,7 @@ * copy[TypeName]ToStage(ID!, FromVersion!, FromStage!, ToStage!) * * @internal This is a low level API that might be removed in the future. Consider using the "rollback" mutation instead - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class CopyToStage extends MutationScaffolder implements OperationResolver { @@ -35,6 +36,7 @@ class CopyToStage extends MutationScaffolder implements OperationResolver */ public function __construct($dataObjectClass) { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); parent::__construct(null, null, $this, $dataObjectClass); } diff --git a/_legacy/GraphQL/Operations/Publish.php b/_legacy/GraphQL/Operations/Publish.php index 95b5deb1..ef40249a 100644 --- a/_legacy/GraphQL/Operations/Publish.php +++ b/_legacy/GraphQL/Operations/Publish.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\Security\Member; use SilverStripe\Versioned\RecursivePublishable; @@ -16,13 +17,21 @@ /** * Scaffolds a generic update operation for DataObjects. * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class Publish extends PublishOperation { /** + * @param string $dataObjectClass + * * @return string */ + public function __construct($dataObjectClass) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($dataObjectClass); + } + protected function createOperationName() { return 'publish' . ucfirst($this->getTypeName()); diff --git a/_legacy/GraphQL/Operations/PublishOperation.php b/_legacy/GraphQL/Operations/PublishOperation.php index a2edbb50..014a2054 100644 --- a/_legacy/GraphQL/Operations/PublishOperation.php +++ b/_legacy/GraphQL/Operations/PublishOperation.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use Exception; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\Type; @@ -24,7 +25,7 @@ /** * Scaffolds a generic update operation for DataObjects. * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ abstract class PublishOperation extends MutationScaffolder implements OperationResolver { @@ -33,6 +34,7 @@ abstract class PublishOperation extends MutationScaffolder implements OperationR */ public function __construct($dataObjectClass) { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); parent::__construct(null, null, $this, $dataObjectClass); } diff --git a/_legacy/GraphQL/Operations/ReadVersions.php b/_legacy/GraphQL/Operations/ReadVersions.php index 775ac591..e04dc38f 100644 --- a/_legacy/GraphQL/Operations/ReadVersions.php +++ b/_legacy/GraphQL/Operations/ReadVersions.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use Exception; use SilverStripe\Core\Injector\Injectable; use GraphQL\Type\Definition\ResolveInfo; @@ -19,7 +20,7 @@ /** * Scaffolds a generic read operation for DataObjects. * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class ReadVersions extends ListQueryScaffolder implements OperationResolver { @@ -32,6 +33,7 @@ class ReadVersions extends ListQueryScaffolder implements OperationResolver */ public function __construct($dataObjectClass, $versionTypeName) { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); $this->setDataObjectClass($dataObjectClass); $operationName = 'read' . ucfirst($versionTypeName); diff --git a/_legacy/GraphQL/Operations/Rollback.php b/_legacy/GraphQL/Operations/Rollback.php index 730b6cec..8242413e 100644 --- a/_legacy/GraphQL/Operations/Rollback.php +++ b/_legacy/GraphQL/Operations/Rollback.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\Type; use InvalidArgumentException; @@ -23,7 +24,7 @@ * * rollback[TypeName](ID!, ToVersion!) * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class Rollback extends MutationScaffolder implements OperationResolver { @@ -34,6 +35,7 @@ class Rollback extends MutationScaffolder implements OperationResolver */ public function __construct($dataObjectClass) { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); parent::__construct(null, null, $this, $dataObjectClass); } diff --git a/_legacy/GraphQL/Operations/Unpublish.php b/_legacy/GraphQL/Operations/Unpublish.php index d2a3a5eb..8c855a91 100644 --- a/_legacy/GraphQL/Operations/Unpublish.php +++ b/_legacy/GraphQL/Operations/Unpublish.php @@ -2,6 +2,7 @@ namespace SilverStripe\Versioned\GraphQL\Operations; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\Security\Member; @@ -16,13 +17,21 @@ /** * Scaffolds a generic update operation for DataObjects. * - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class Unpublish extends PublishOperation { /** + * @param string $dataObjectClass + * * @return string */ + public function __construct($dataObjectClass) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($dataObjectClass); + } + protected function createOperationName() { return 'unpublish'.ucfirst($this->getTypeName()); diff --git a/_legacy/GraphQL/Resolvers/ApplyVersionFilters.php b/_legacy/GraphQL/Resolvers/ApplyVersionFilters.php index 76e32537..5e950f9e 100644 --- a/_legacy/GraphQL/Resolvers/ApplyVersionFilters.php +++ b/_legacy/GraphQL/Resolvers/ApplyVersionFilters.php @@ -2,6 +2,7 @@ namespace SilverStripe\GraphQL\Resolvers; +use SilverStripe\Dev\Deprecation; use SilverStripe\GraphQL\Scaffolding\StaticSchema; use SilverStripe\ORM\DataList; use SilverStripe\Versioned\Versioned; @@ -15,7 +16,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class ApplyVersionFilters { @@ -27,6 +28,11 @@ class ApplyVersionFilters * * @param $versioningArgs */ + public function __construct() + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + } + public function applyToReadingState($versioningArgs) { list ($mode, $archiveDate) = StaticSchema::inst()->extractKeys( diff --git a/_legacy/GraphQL/Types/CopyToStageInputType.php b/_legacy/GraphQL/Types/CopyToStageInputType.php index 7a12f85b..dbe1d3be 100644 --- a/_legacy/GraphQL/Types/CopyToStageInputType.php +++ b/_legacy/GraphQL/Types/CopyToStageInputType.php @@ -2,8 +2,10 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\Type; use SilverStripe\GraphQL\Scaffolding\StaticSchema; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; // GraphQL dependency is optional in versioned, @@ -13,7 +15,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class CopyToStageInputType extends TypeCreator { @@ -25,6 +27,12 @@ class CopyToStageInputType extends TypeCreator /** * @return array */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function attributes() { return [ diff --git a/_legacy/GraphQL/Types/VersionSortType.php b/_legacy/GraphQL/Types/VersionSortType.php index 1fd2c5f4..7d761b09 100644 --- a/_legacy/GraphQL/Types/VersionSortType.php +++ b/_legacy/GraphQL/Types/VersionSortType.php @@ -3,8 +3,10 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use SilverStripe\Core\Injector\Injector; use SilverStripe\GraphQL\Pagination\SortDirectionTypeCreator; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; // GraphQL dependency is optional in versioned, @@ -14,7 +16,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class VersionSortType extends TypeCreator { @@ -31,6 +33,12 @@ class VersionSortType extends TypeCreator /** * @return array */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function attributes() { return [ diff --git a/_legacy/GraphQL/Types/VersionedInputType.php b/_legacy/GraphQL/Types/VersionedInputType.php index 531795fd..45746cb6 100644 --- a/_legacy/GraphQL/Types/VersionedInputType.php +++ b/_legacy/GraphQL/Types/VersionedInputType.php @@ -2,8 +2,10 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\Type; use SilverStripe\GraphQL\Scaffolding\StaticSchema; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; use SilverStripe\Versioned\Versioned; @@ -14,7 +16,7 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class VersionedInputType extends TypeCreator { @@ -26,6 +28,12 @@ class VersionedInputType extends TypeCreator /** * @return array */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function attributes() { return [ diff --git a/_legacy/GraphQL/Types/VersionedQueryMode.php b/_legacy/GraphQL/Types/VersionedQueryMode.php index c3f8f19c..ec0fadb8 100644 --- a/_legacy/GraphQL/Types/VersionedQueryMode.php +++ b/_legacy/GraphQL/Types/VersionedQueryMode.php @@ -2,7 +2,9 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\EnumType; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; use SilverStripe\Versioned\Versioned; @@ -13,13 +15,19 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class VersionedQueryMode extends TypeCreator { /** * @return EnumType */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function toType() { return new EnumType([ diff --git a/_legacy/GraphQL/Types/VersionedStage.php b/_legacy/GraphQL/Types/VersionedStage.php index 95f265b9..70a81eba 100644 --- a/_legacy/GraphQL/Types/VersionedStage.php +++ b/_legacy/GraphQL/Types/VersionedStage.php @@ -2,7 +2,9 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\EnumType; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; use SilverStripe\Versioned\Versioned; @@ -13,13 +15,19 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class VersionedStage extends TypeCreator { /** * @return EnumType */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function toType() { return new EnumType([ diff --git a/_legacy/GraphQL/Types/VersionedStatus.php b/_legacy/GraphQL/Types/VersionedStatus.php index b1b93a4e..43fc1f82 100644 --- a/_legacy/GraphQL/Types/VersionedStatus.php +++ b/_legacy/GraphQL/Types/VersionedStatus.php @@ -2,7 +2,9 @@ namespace SilverStripe\Versioned\GraphQL\Types; +use SilverStripe\Dev\Deprecation; use GraphQL\Type\Definition\EnumType; +use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\TypeCreator; // GraphQL dependency is optional in versioned, @@ -12,13 +14,19 @@ } /** - * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. + * @deprecated 1.8.0 Use the latest version of graphql instead */ class VersionedStatus extends TypeCreator { /** * @return EnumType */ + public function __construct(Manager $manager = null) + { + Deprecation::notice('1.8.0', 'Use the latest version of graphql instead', Deprecation::SCOPE_CLASS); + parent::__construct($manager); + } + public function toType() { return new EnumType([ diff --git a/src/Dev/VersionedTestSessionExtension.php b/src/Dev/VersionedTestSessionExtension.php index dcf32bf4..5de18d25 100644 --- a/src/Dev/VersionedTestSessionExtension.php +++ b/src/Dev/VersionedTestSessionExtension.php @@ -3,6 +3,7 @@ namespace SilverStripe\Versioned\Dev; +use SilverStripe\Dev\Deprecation; use SilverStripe\Dev\TestSession; use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\VersionedStateExtension; @@ -11,7 +12,7 @@ * Decorates TestSession object to update get / post requests with versioned querystring arguments. * Session vars assigned by FunctionalTest::useDraftSite are respected here. * - * @deprecated 2.2..3.0 Use ?stage= querystring arguments instead of session + * @deprecated 2.2.0 Use ?stage=Stage|Live in your request's querystring instead * @property TestSession $owner */ class VersionedTestSessionExtension extends VersionedStateExtension @@ -21,6 +22,11 @@ class VersionedTestSessionExtension extends VersionedStateExtension * * @param string $url */ + public function __construct() + { + Deprecation::notice('2.2.0', 'Use ?stage=Stage|Live in your request\'s querystring instead', Deprecation::SCOPE_CLASS); + } + public function updateLink(&$url) { $session = $this->owner->session(); diff --git a/src/Versioned.php b/src/Versioned.php index c431250a..f0be1911 100644 --- a/src/Versioned.php +++ b/src/Versioned.php @@ -375,13 +375,13 @@ public function getAtVersion($from) /** * Get modified date for the given version * - * @deprecated 4.2..5.0 Use getLastEditedAndStageForVersion instead + * @deprecated 1.2.0 Use getLastEditedAndStageForVersion() instead * @param int $version * @return string */ protected function getLastEditedForVersion($version) { - Deprecation::notice('5.0', 'Use getLastEditedAndStageForVersion instead'); + Deprecation::notice('1.2.0', 'Use getLastEditedAndStageForVersion() instead'); $result = $this->getLastEditedAndStageForVersion($version); if ($result) { return reset($result); @@ -1816,11 +1816,11 @@ public function latestPublished() } /** - * @deprecated 4.0..5.0 + * @deprecated 1.0.0 Use publishRecursive() instead */ public function doPublish() { - Deprecation::notice('5.0', 'Use publishRecursive instead'); + Deprecation::notice('1.0.0', 'Use publishRecursive() instead'); return $this->owner->publishRecursive(); } @@ -1964,18 +1964,19 @@ public function doRevertToLive() } /** - * @deprecated 1.2..2.0 This extension method is redundant and will be removed + * @deprecated 1.2.0 Will be removed without equivalent functionality to replace it */ public function onAfterRevertToLive() { + Deprecation::notice('1.2.0', 'Will be removed without equivalent functionality to replace it'); } /** - * @deprecated 4.0..5.0 + * @deprecated 1.0.0 Use copyVersionToStage() instead */ public function publish($fromStage, $toStage, $createNewVersion = true) { - Deprecation::notice('5.0', 'Use copyVersionToStage instead'); + Deprecation::notice('1.0.0', 'Use copyVersionToStage() instead'); $this->owner->copyVersionToStage($fromStage, $toStage, true); } @@ -2020,12 +2021,12 @@ public function getMigratingVersion() } /** - * @deprecated 4.0...5.0 + * @deprecated 1.0.0 Use setMigratingVersion() instead * @param string $version The version. */ public function migrateVersion($version) { - Deprecation::notice('5.0', 'use setMigratingVersion instead'); + Deprecation::notice('1.0.0', 'Use setMigratingVersion() instead'); $this->setMigratingVersion($version); } @@ -2083,11 +2084,12 @@ public function Versions($filter = "", $sort = "", $limit = "", $join = "", $hav * NOTE: Versions() will be replaced with this method in SilverStripe 5.0 * * @internal - * @deprecated 1.5.0 Will be removed in 2.0.0, use Versions() instead + * @deprecated 1.5.0 Use Versions() instead * @return DataList */ public function VersionsList() { + Deprecation::notice('1.5.0', 'Use Versions() instead'); $id = $this->owner->ID ?: $this->owner->OldID; $class = DataObject::getSchema()->baseDataClass($this->owner); return Versioned::get_all_versions($class, $id); @@ -2096,16 +2098,17 @@ public function VersionsList() /** * Return a list of all the versions available. * - * @deprecated 1.5.0 Will be removed in 2.0.0, please use Versions() instead + * @deprecated 1.5.0 Use Versions() instead * @param string $filter * @param string $sort * @param string $limit - * @param string $join @deprecated use leftJoin($table, $joinClause) instead - * @param string $having @deprecated + * @param string $join + * @param string $having * @return ArrayList */ public function allVersions($filter = "", $sort = "", $limit = "", $join = "", $having = "") { + Deprecation::notice('1.5.0', 'Use Versions() instead'); /** @var DataObject $owner */ $owner = $this->owner; @@ -2687,12 +2690,12 @@ public function writeToStage($stage, $forceInsert = false) * * {@see doRevertToLive()} to reollback to live * - * @deprecated 4.2..5.0 Use rollbackRecursive() instead + * @deprecated 1.2.0 Use rollbackRecursive() instead * @param int $version Version number */ public function doRollbackTo($version) { - Deprecation::notice('5.0', 'Use rollbackRecursive() instead'); + Deprecation::notice('1.2.0', 'Use rollbackRecursive() instead'); $owner = $this->owner; $owner->extend('onBeforeRollback', $version); $owner->rollbackRecursive($version); @@ -2700,10 +2703,11 @@ public function doRollbackTo($version) } /** - * @deprecated 1.2..2.0 This extension method is redundant and will be removed + * @deprecated 1.2.0 Will be removed without equivalent functionality to replace it */ public function onAfterRollback() { + Deprecation::notice('1.2.0', 'Will be removed without equivalent functionality to replace it'); } /**