Skip to content

Commit c28f5f8

Browse files
authored
test(coder): Update Coder to 8.3.14 (#1264)
1 parent bde834d commit c28f5f8

9 files changed

Lines changed: 8 additions & 17 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
run: |
9292
mkdir coder
9393
cd coder
94-
composer require drupal/coder:8.3.12 --no-interaction --no-progress
94+
composer require drupal/coder:8.3.14 --no-interaction --no-progress
9595
9696
- name: Run PHPUnit
9797
run: |
@@ -106,5 +106,4 @@ jobs:
106106
107107
- name: Run PHPCS
108108
run: |
109-
./coder/vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer
110109
cd modules/graphql && ../../coder/vendor/bin/phpcs -p

phpcs.xml.dist

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
<rule ref="Drupal"></rule>
1010
<rule ref="DrupalPractice"></rule>
1111

12-
<!-- TODO: Bug in Coder with variadic parameters -->
13-
<rule ref="Drupal.Commenting.FunctionComment.ParamTypeSpaces">
14-
<exclude-pattern>src/GraphQL/ResolverBuilder.php</exclude-pattern>
15-
</rule>
16-
<rule ref="Drupal.Commenting.FunctionComment.SpacingAfterParamType">
17-
<exclude-pattern>src/GraphQL/ResolverBuilder.php</exclude-pattern>
18-
</rule>
19-
2012
<!-- We want to document the return type on the base class even when there is
2113
no return statement on the default implementation. -->
2214
<rule ref="Drupal.Commenting.FunctionComment.InvalidNoReturn">

src/GraphQL/Buffers/EntityBuffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function resolveBufferArray(array $buffer) {
8282
}, []);
8383
}
8484

85-
return isset($entities[$item['id']]) ? $entities[$item['id']] : NULL;
85+
return $entities[$item['id']] ?? NULL;
8686
}, $buffer);
8787
}
8888

src/GraphQL/Buffers/EntityRevisionBuffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function resolveBufferArray(array $buffer) {
8181
}, []);
8282
}
8383

84-
return isset($entities[$item['vid']]) ? $entities[$item['vid']] : NULL;
84+
return $entities[$item['vid']] ?? NULL;
8585
}, $buffer);
8686
}
8787

src/GraphQL/Buffers/EntityUuidBuffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function resolveBufferArray(array $buffer) {
9292
}, []);
9393
}
9494

95-
return isset($entities[$item['uuid']]) ? $entities[$item['uuid']] : NULL;
95+
return $entities[$item['uuid']] ?? NULL;
9696
}, $buffer);
9797
}
9898

src/GraphQL/Resolver/Condition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(array $branches) {
3737
*/
3838
public function resolve($value, $args, ResolveContext $context, ResolveInfo $info, FieldContext $field) {
3939
$branches = $this->branches;
40-
while (list($condition, $resolver) = array_pad(array_shift($branches), 2, NULL)) {
40+
while ([$condition, $resolver] = array_pad(array_shift($branches), 2, NULL)) {
4141
if ($condition instanceof ResolverInterface) {
4242
if (($condition = $condition->resolve($value, $args, $context, $info, $field)) === NULL) {
4343
// Bail out early if a resolver returns NULL.

src/PersistedQuery/PersistedQueryPluginBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function label() {
4444
*/
4545
public function getDescription() {
4646
$plugin_definition = $this->getPluginDefinition();
47-
return isset($plugin_definition['description']) ? $plugin_definition['description'] : '';
47+
return $plugin_definition['description'] ?? '';
4848
}
4949

5050
/**

src/Plugin/GraphQL/DataProducer/DataProducerProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function resolveUncached(DataProducerPluginInterface $plugin, ResolveC
253253
protected function resolveCached(DataProducerPluginCachingInterface $plugin, ResolveContext $context, FieldContext $field) {
254254
$prefix = $this->edgeCachePrefix($plugin);
255255
if ($cache = $this->cacheRead($prefix)) {
256-
list($value, $metadata) = $cache;
256+
[$value, $metadata] = $cache;
257257
$field->addCacheableDependency($metadata);
258258
return $value;
259259
}

src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function __construct(
107107
*/
108108
public function resolve($url, ?string $language, FieldContext $context): ?Deferred {
109109
if ($url instanceof Url) {
110-
list(, $type) = explode('.', $url->getRouteName());
110+
[, $type] = explode('.', $url->getRouteName());
111111
$parameters = $url->getRouteParameters();
112112
$id = $parameters[$type];
113113
$resolver = $this->entityBuffer->add($type, $id);

0 commit comments

Comments
 (0)