Skip to content

Commit

Permalink
API Deprecate API that will be removed (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Sep 13, 2024
1 parent 732929a commit 76f8044
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Dev/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\DebugView;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor;
use SilverStripe\GraphQL\Schema\Exception\EmptySchemaException;
use SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException;
Expand All @@ -19,6 +20,9 @@
use SilverStripe\GraphQL\Schema\Storage\CodeGenerationStore;
use SilverStripe\ORM\Connect\NullDatabaseException;

/**
* @deprecated 5.3.0 Will be replaced with SilverStripe\GraphQL\Dev\SchemaBuild
*/
class Build extends Controller
{
private static $url_handlers = [
Expand All @@ -29,6 +33,18 @@ class Build extends Controller
'build'
];

public function __construct()
{
parent::__construct();
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with SilverStripe\GraphQL\Dev\SchemaBuild',
Deprecation::SCOPE_CLASS
);
});
}

/**
* @throws SchemaBuilderException
* @throws SchemaNotFoundException
Expand Down
16 changes: 16 additions & 0 deletions src/Dev/DevelopmentAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
use Exception;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Schema\Logger;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class DevelopmentAdmin extends Controller implements PermissionProvider
{
private static $allowed_actions = [
Expand All @@ -34,6 +38,18 @@ class DevelopmentAdmin extends Controller implements PermissionProvider
'CAN_DEV_GRAPHQL',
];

public function __construct()
{
parent::__construct();
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
}

protected function init()
{
parent::init();
Expand Down
14 changes: 14 additions & 0 deletions src/Extensions/DevBuildExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Dev\Build;
use SilverStripe\GraphQL\Schema\Logger;
use SilverStripe\ORM\DatabaseAdmin;
use SilverStripe\ORM\DataExtension;

/**
* @extends DataExtension<DatabaseAdmin>
* @deprecated 5.4.0 Will be replaced with SilverStripe\GraphQL\Extensions\DbBuildExtension
*/
class DevBuildExtension extends DataExtension
{
Expand All @@ -23,6 +25,18 @@ class DevBuildExtension extends DataExtension
*/
private static bool $enabled = true;

public function __construct()
{
parent::__construct();
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with SilverStripe\GraphQL\Extensions\DbBuildExtension',
Deprecation::SCOPE_CLASS
);
});
}

public function onAfterBuild(): void
{
if (!static::config()->get('enabled')) {
Expand Down

0 comments on commit 76f8044

Please sign in to comment.