Skip to content

Commit efecfb1

Browse files
authored
style(phpcs): Fix unused use statements and array coding standards (#1070)
1 parent 0c36694 commit efecfb1

33 files changed

Lines changed: 45 additions & 66 deletions

phpcs.xml.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77

88
<rule ref="Drupal">
99
<!-- TODO: those rules are disabled for now until we fix the coding standards for them. -->
10-
<exclude name="Drupal.Arrays.Array.CommaLastItem"/>
11-
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>
12-
<exclude name="Drupal.Arrays.DisallowLongArraySyntax.Found"/>
13-
<exclude name="Drupal.Classes.ClassDeclaration.CloseBraceAfterBody"/>
14-
<exclude name="Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing"/>
15-
<exclude name="Drupal.Classes.PropertyDeclaration.ScopeMissing"/>
16-
<exclude name="Drupal.Classes.UnusedUseStatement.UnusedUse"/>
1710
<exclude name="Drupal.Commenting.ClassComment.Missing"/>
1811
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
1912
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>

src/Config/LanguageConfigOverride.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Drupal\Core\Cache\CacheableMetadata;
66
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
77
use Drupal\Core\Config\StorageInterface;
8-
use Drupal\graphql\Plugin\LanguageNegotiation\OperationLanguageNegotiation;
98
use Drupal\language\LanguageNegotiationMethodManager;
109

1110
/**

src/Form/PersistedQueriesForm.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Drupal\Core\Form\FormStateInterface;
88
use Drupal\Core\Form\SubformState;
99
use Drupal\Core\Plugin\PluginFormInterface;
10-
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
1110
use Drupal\graphql\Plugin\PersistedQueryPluginManager;
1211
use Symfony\Component\DependencyInjection\ContainerInterface;
1312

@@ -90,7 +89,7 @@ public function form(array $form, FormStateInterface $form_state) {
9089
$form['weights']['order']['#tabledrag'][] = [
9190
'action' => 'order',
9291
'relationship' => 'sibling',
93-
'group' => 'persisted-query-plugin-weight'
92+
'group' => 'persisted-query-plugin-weight',
9493
];
9594
$plugins_weight = [];
9695
foreach ($all_plugins as $plugin_id => $plugin) {

src/GraphQL/Execution/ExecutionResult.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Drupal\graphql\GraphQL\Execution;
44

5+
use GraphQL\Executor\ExecutionResult as LibraryExecutionResult;
56
use Drupal\Core\Cache\CacheableDependencyInterface;
67
use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
78

8-
class ExecutionResult extends \GraphQL\Executor\ExecutionResult implements CacheableDependencyInterface {
9+
class ExecutionResult extends LibraryExecutionResult implements CacheableDependencyInterface {
910
use RefinableCacheableDependencyTrait;
1011

1112
}

src/GraphQL/Execution/Executor.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,16 @@ protected function cacheWrite($prefix, CacheableExecutionResult $result) {
331331
];
332332

333333
$this->cacheBackend->setMultiple([
334-
"contexts:$prefix" => ['data' => $contexts, 'expire' => $expire, 'tags' => $tags],
335-
"result:$prefix:$suffix" => ['data' => $cache, 'expire' => $expire, 'tags' => $tags],
334+
"contexts:$prefix" => [
335+
'data' => $contexts,
336+
'expire' => $expire,
337+
'tags' => $tags,
338+
],
339+
"result:$prefix:$suffix" => [
340+
'data' => $cache,
341+
'expire' => $expire,
342+
'tags' => $tags,
343+
],
336344
]);
337345

338346
return $this;

src/GraphQL/Utility/DeferredUtility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DeferredUtility {
1212
*
1313
* @var \GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter
1414
*/
15-
static $promiseAdapter;
15+
public static $promiseAdapter;
1616

1717
/**
1818
* Return the singleton promise adapter.

src/Plugin/DataProducerPluginInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Drupal\graphql\Plugin;
44

5-
use Drupal\Component\Plugin\ConfigurableInterface;
65
use Drupal\Component\Plugin\DerivativeInspectionInterface;
76
use Drupal\Core\Cache\CacheableDependencyInterface;
87
use Drupal\Core\Plugin\ContextAwarePluginInterface;

src/Plugin/GraphQL/DataProducer/Entity/EntityLabel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
namespace Drupal\graphql\Plugin\GraphQL\DataProducer\Entity;
44

55
use Drupal\Core\Entity\EntityInterface;
6-
use Drupal\graphql\GraphQL\Execution\ResolveContext;
76
use Drupal\graphql\Plugin\DataProducerPluginCachingInterface;
87
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
9-
use GraphQL\Type\Definition\ResolveInfo;
108

119
/**
1210
* @DataProducer(

src/Plugin/GraphQL/DataProducer/Field/EntityReferenceLayoutRevisions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Drupal\graphql\Plugin\GraphQL\DataProducer\Field;
44

5-
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
65
use Drupal\Core\Entity\EntityInterface;
76
use Drupal\Core\Entity\EntityTypeManager;
87
use Drupal\Core\Entity\FieldableEntityInterface;

src/Plugin/GraphQL/DataProducer/Field/EntityReferenceRevisions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Drupal\graphql\Plugin\GraphQL\DataProducer\Field;
44

5-
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
65
use Drupal\Core\Entity\EntityInterface;
76
use Drupal\Core\Entity\EntityTypeManager;
87
use Drupal\Core\Entity\FieldableEntityInterface;

0 commit comments

Comments
 (0)