Skip to content

Commit

Permalink
Merge pull request #357 from creative-commoners/pulls/1/php81-manual
Browse files Browse the repository at this point in the history
ENH Fix deprecation issues for PHP 8.1 compatibility
  • Loading branch information
Maxime Rainville authored Apr 7, 2022
2 parents 8545d0c + 6899a88 commit fab7143
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/GraphQL/Operations/AbstractPublishOperationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Type\Definition\Type;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Extensible;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\GraphQL\Manager;
use SilverStripe\GraphQL\OperationResolver;
Expand All @@ -23,6 +22,7 @@
use SilverStripe\Security\Member;
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -53,7 +53,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!Extensible::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
3 changes: 2 additions & 1 deletion src/GraphQL/Operations/CopyToStageCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface;
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -48,7 +49,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!Extensible::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Operations/RollbackCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SilverStripe\Versioned\GraphQL\Operations;

use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Extensible;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException;
use SilverStripe\GraphQL\Schema\Field\ModelMutation;
Expand All @@ -12,6 +11,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface;
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -47,7 +47,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!Extensible::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Plugins/UnpublishOnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace SilverStripe\Versioned\GraphQL\Plugins;

use SilverStripe\Core\Extensible;
use SilverStripe\GraphQL\QueryHandler\QueryHandler;
use SilverStripe\GraphQL\QueryHandler\UserContextProvider;
use SilverStripe\GraphQL\Schema\Field\ModelMutation;
Expand All @@ -15,6 +14,7 @@
use SilverStripe\Versioned\Versioned;
use Exception;
use Closure;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -53,7 +53,7 @@ public static function unpublishOnDelete(array $context)
if (!$dataClass) {
return;
}
if (!Extensible::has_extension($dataClass, Versioned::class)) {
if (!ViewableData::has_extension($dataClass, Versioned::class)) {
return;
}
DB::get_conn()->withTransaction(function () use ($args, $context, $dataClass) {
Expand Down
5 changes: 2 additions & 3 deletions src/GraphQL/Plugins/VersionedDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace SilverStripe\Versioned\GraphQL\Plugins;

use SilverStripe\Core\Extensible;
use SilverStripe\GraphQL\Schema\DataObject\Plugin\Paginator;
use SilverStripe\GraphQL\Schema\DataObject\Plugin\ScalarDBField;
use SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException;
Expand All @@ -23,6 +22,7 @@
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use Closure;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -75,8 +75,7 @@ public function apply(ModelType $type, Schema $schema, array $config = []): void
__CLASS__,
DataObject::class
);

if (!Extensible::has_extension($class, Versioned::class)) {
if (!ViewableData::has_extension($class, Versioned::class)) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Plugins/VersionedRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace SilverStripe\Versioned\GraphQL\Plugins;

use SilverStripe\Core\Extensible;
use SilverStripe\GraphQL\Schema\Field\ModelQuery;
use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -36,7 +36,7 @@ public function getIdentifier(): string
public function apply(ModelQuery $query, Schema $schema, array $config = []): void
{
$class = $query->getModel()->getSourceClass();
if (!Extensible::has_extension($class, Versioned::class)) {
if (!ViewableData::has_extension($class, Versioned::class)) {
return;
}

Expand Down

0 comments on commit fab7143

Please sign in to comment.