Skip to content

Commit b9614c5

Browse files
authored
style(coder): Upgrde Coder to 8.3.21 (#1363)
1 parent 4452ea6 commit b9614c5

32 files changed

Lines changed: 78 additions & 80 deletions

.github/workflows/testing.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
drupal:
99
name: Drupal ${{ matrix.drupal-core }} (PHP ${{ matrix.php-versions }})
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
env:
1212
extensions: mbstring, xml, pdo_sqlite, gd, opcache
1313
strategy:
@@ -65,7 +65,7 @@ jobs:
6565

6666
- name: Get composer cache directory
6767
id: composercache
68-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
68+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6969

7070
- name: Cache composer dependencies
7171
uses: actions/cache@v3
@@ -83,25 +83,11 @@ jobs:
8383
composer config --no-plugins allow-plugins.phpstan/extension-installer true
8484
8585
- name: Install GraphQL dependencies
86-
run: composer --no-interaction --no-progress require \
87-
webonyx/graphql-php:^14.8 \
88-
drupal/typed_data:^1.0 \
89-
drupal/redirect:^1.0 \
90-
phpstan/phpstan:^1.10.32 \
91-
mglaman/phpstan-drupal:^1.1.2 \
92-
phpstan/phpstan-deprecation-rules:^1.0.0 \
93-
jangregor/phpstan-prophecy:^1.0.0 \
94-
phpstan/phpstan-phpunit:^1.0.0 \
95-
phpstan/extension-installer:^1.0
96-
97-
# We install Coder separately because updating did not work in the local
98-
# Drupal vendor dir.
99-
- name: Install Coder
10086
run: |
101-
mkdir coder
102-
cd coder
103-
echo '{"config": {"allow-plugins": {"dealerdirect/phpcodesniffer-composer-installer": true}}}' > composer.json
104-
composer require drupal/coder:8.3.15 --no-interaction --no-progress
87+
composer --no-interaction --no-progress require \
88+
webonyx/graphql-php:^14.8 \
89+
drupal/typed_data:^1.0 \
90+
drupal/redirect:^1.0
10591
10692
- name: Run PHPUnit
10793
run: |
@@ -110,11 +96,23 @@ jobs:
11096
env:
11197
SIMPLETEST_DB: "sqlite://localhost/:memory:"
11298

99+
- name: Install PHPStan and Coder dependencies
100+
if: ${{ matrix.phpstan == '1' }}
101+
# Pin the exact Coder version to upgrade manually when we want to.
102+
run: |
103+
composer --no-interaction --no-progress require \
104+
phpstan/phpstan:^1.10.32 \
105+
mglaman/phpstan-drupal:^1.1.2 \
106+
phpstan/phpstan-deprecation-rules:^1.0.0 \
107+
jangregor/phpstan-prophecy:^1.0.0 \
108+
phpstan/phpstan-phpunit:^1.0.0 \
109+
phpstan/extension-installer:^1.0
110+
composer --no-interaction --no-progress --with-all-dependencies upgrade drupal/coder:8.3.21
111+
113112
- name: Run PHPStan
114-
# phpstan-drupal bug, so we remove 1 stub file
115-
# https://github.com/mglaman/phpstan-drupal/issues/509
116-
run: if [[ ${{ matrix.phpstan }} == "1" ]]; then rm vendor/mglaman/phpstan-drupal/stubs/Drupal/Core/Field/FieldItemList.stub && cd modules/graphql && ../../vendor/bin/phpstan analyse; fi
113+
if: ${{ matrix.phpstan == '1' }}
114+
run: cd modules/graphql && ../../vendor/bin/phpstan analyse
117115

118116
- name: Run PHPCS
119-
run: |
120-
cd modules/graphql && ../../coder/vendor/bin/phpcs -p
117+
if: ${{ matrix.phpstan == '1' }}
118+
run: cd modules/graphql && ../../vendor/bin/phpcs -p

examples/graphql_composable/src/Plugin/GraphQL/DataProducer/CreateArticle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
66
use Drupal\Core\Session\AccountInterface;
7+
use Drupal\Core\StringTranslation\StringTranslationTrait;
78
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
89
use Drupal\graphql_composable\GraphQL\Response\ArticleResponse;
910
use Drupal\node\Entity\Node;
1011
use Symfony\Component\DependencyInjection\ContainerInterface;
11-
use Drupal\Core\StringTranslation\StringTranslationTrait;
1212

1313
/**
1414
* Creates a new article entity.

src/Entity/Server.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
use Drupal\Core\Entity\EntityStorageInterface;
1010
use Drupal\graphql\GraphQL\Execution\ExecutionResult as CacheableExecutionResult;
1111
use Drupal\graphql\GraphQL\Execution\FieldContext;
12-
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
13-
use GraphQL\Error\DebugFlag;
14-
use GraphQL\Server\OperationParams;
1512
use Drupal\graphql\GraphQL\Execution\ResolveContext;
16-
use GraphQL\Server\ServerConfig;
1713
use Drupal\graphql\GraphQL\ResolverRegistryInterface;
1814
use Drupal\graphql\GraphQL\Utility\DeferredUtility;
15+
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
1916
use Drupal\graphql\Plugin\SchemaPluginInterface;
17+
use GraphQL\Error\DebugFlag;
2018
use GraphQL\Error\Error;
2119
use GraphQL\Error\FormattedError;
2220
use GraphQL\Executor\Executor;
2321
use GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter;
2422
use GraphQL\Language\AST\DocumentNode;
2523
use GraphQL\Server\Helper;
24+
use GraphQL\Server\OperationParams;
25+
use GraphQL\Server\ServerConfig;
2626
use GraphQL\Type\Definition\ResolveInfo;
2727
use GraphQL\Validator\DocumentValidator;
2828
use GraphQL\Validator\Rules\DisableIntrospection;

src/Event/OperationEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Drupal\graphql\Event;
44

5+
use Drupal\Component\EventDispatcher\Event;
56
use Drupal\graphql\GraphQL\Execution\ResolveContext;
67
use GraphQL\Executor\ExecutionResult;
7-
use Drupal\Component\EventDispatcher\Event;
88

99
/**
1010
* Represents an event that is triggered before and after a GraphQL operation.

src/EventSubscriber/ApqSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Drupal\Core\Cache\CacheBackendInterface;
66
use Drupal\graphql\Event\OperationEvent;
7-
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
87
use GraphQL\Error\Error;
8+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
99

1010
/**
1111
* Save persisted queries to cache.

src/GraphQL/Execution/ExecutionResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Drupal\graphql\GraphQL\Execution;
44

5-
use GraphQL\Executor\ExecutionResult as LibraryExecutionResult;
65
use Drupal\Core\Cache\CacheableDependencyInterface;
76
use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
7+
use GraphQL\Executor\ExecutionResult as LibraryExecutionResult;
88

99
/**
1010
* Expand the upstream ExecutionResult to make it Drupal cachable.

src/GraphQL/Resolver/Composite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Drupal\graphql\GraphQL\Resolver;
44

55
use Drupal\graphql\GraphQL\Execution\FieldContext;
6-
use GraphQL\Executor\Promise\Adapter\SyncPromise;
7-
use Drupal\graphql\GraphQL\Utility\DeferredUtility;
86
use Drupal\graphql\GraphQL\Execution\ResolveContext;
7+
use Drupal\graphql\GraphQL\Utility\DeferredUtility;
8+
use GraphQL\Executor\Promise\Adapter\SyncPromise;
99
use GraphQL\Type\Definition\ResolveInfo;
1010

1111
/**

src/GraphQL/ResolverBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
use Drupal\graphql\GraphQL\Resolver\DefaultValue;
1212
use Drupal\graphql\GraphQL\Resolver\Map;
1313
use Drupal\graphql\GraphQL\Resolver\ParentValue;
14+
use Drupal\graphql\GraphQL\Resolver\ResolverInterface;
1415
use Drupal\graphql\GraphQL\Resolver\SourceContext;
1516
use Drupal\graphql\GraphQL\Resolver\Tap;
1617
use Drupal\graphql\GraphQL\Resolver\Value;
1718
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerProxy;
1819
use Drupal\typed_data\DataFetcherTrait;
19-
use Drupal\graphql\GraphQL\Resolver\ResolverInterface;
2020

2121
/**
2222
* Wires and maps different resolvers together to build the GraphQL tree.

src/GraphQL/ResolverRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use Drupal\graphql\GraphQL\Execution\FieldContext;
66
use Drupal\graphql\GraphQL\Execution\ResolveContext;
7+
use Drupal\graphql\GraphQL\Resolver\ResolverInterface;
78
use GraphQL\Executor\Executor;
89
use GraphQL\Type\Definition\ImplementingType;
910
use GraphQL\Type\Definition\ResolveInfo;
1011
use GraphQL\Type\Definition\Type;
11-
use Drupal\graphql\GraphQL\Resolver\ResolverInterface;
1212

1313
/**
1414
* Contains all the mappings how to resolve a GraphQL request.

src/GraphQL/Utility/FileUpload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Drupal\Component\Utility\Environment;
99
use Drupal\Core\Config\ConfigFactoryInterface;
1010
use Drupal\Core\Entity\EntityTypeManagerInterface;
11+
use Drupal\Core\File\Event\FileUploadSanitizeNameEvent;
1112
use Drupal\Core\File\Exception\FileException;
1213
use Drupal\Core\File\FileSystemInterface;
1314
use Drupal\Core\Image\ImageFactory;
@@ -20,10 +21,9 @@
2021
use Drupal\Core\Utility\Token;
2122
use Drupal\file\FileInterface;
2223
use Drupal\graphql\GraphQL\Response\FileUploadResponse;
24+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2325
use Symfony\Component\HttpFoundation\File\UploadedFile;
24-
use Drupal\Core\File\Event\FileUploadSanitizeNameEvent;
2526
use Symfony\Component\Mime\MimeTypeGuesserInterface;
26-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2727

2828
/**
2929
* Service to manage file uploads within GraphQL mutations.

0 commit comments

Comments
 (0)