Unverified Commit b9614c5b authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

style(coder): Upgrde Coder to 8.3.21 (#1363)

parent 4452ea6e
Loading
Loading
Loading
Loading
+23 −25
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ on:
jobs:
  drupal:
    name: Drupal ${{ matrix.drupal-core }} (PHP ${{ matrix.php-versions }})
    runs-on: ubuntu-20.04
    runs-on: ubuntu-latest
    env:
      extensions: mbstring, xml, pdo_sqlite, gd, opcache
    strategy:
@@ -65,7 +65,7 @@ jobs:

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

      - name: Cache composer dependencies
        uses: actions/cache@v3
@@ -83,25 +83,11 @@ jobs:
          composer config --no-plugins allow-plugins.phpstan/extension-installer true

      - name: Install GraphQL dependencies
        run: composer --no-interaction --no-progress require \
        run: |
          composer --no-interaction --no-progress require \
            webonyx/graphql-php:^14.8 \
            drupal/typed_data:^1.0 \
          drupal/redirect:^1.0 \
          phpstan/phpstan:^1.10.32 \
          mglaman/phpstan-drupal:^1.1.2 \
          phpstan/phpstan-deprecation-rules:^1.0.0 \
          jangregor/phpstan-prophecy:^1.0.0 \
          phpstan/phpstan-phpunit:^1.0.0 \
          phpstan/extension-installer:^1.0

      # We install Coder separately because updating did not work in the local
      # Drupal vendor dir.
      - name: Install Coder
        run: |
          mkdir coder
          cd coder
          echo '{"config": {"allow-plugins": {"dealerdirect/phpcodesniffer-composer-installer": true}}}' > composer.json
          composer require drupal/coder:8.3.15 --no-interaction --no-progress
            drupal/redirect:^1.0

      - name: Run PHPUnit
        run: |
@@ -110,11 +96,23 @@ jobs:
        env:
          SIMPLETEST_DB: "sqlite://localhost/:memory:"

      - name: Install PHPStan and Coder dependencies
        if: ${{ matrix.phpstan == '1' }}
        # Pin the exact Coder version to upgrade manually when we want to.
        run: |
          composer --no-interaction --no-progress require \
            phpstan/phpstan:^1.10.32 \
            mglaman/phpstan-drupal:^1.1.2 \
            phpstan/phpstan-deprecation-rules:^1.0.0 \
            jangregor/phpstan-prophecy:^1.0.0 \
            phpstan/phpstan-phpunit:^1.0.0 \
            phpstan/extension-installer:^1.0
          composer --no-interaction --no-progress --with-all-dependencies upgrade drupal/coder:8.3.21

      - name: Run PHPStan
        # phpstan-drupal bug, so we remove 1 stub file
        # https://github.com/mglaman/phpstan-drupal/issues/509
        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
        if: ${{ matrix.phpstan == '1' }}
        run: cd modules/graphql && ../../vendor/bin/phpstan analyse

      - name: Run PHPCS
        run: |
          cd modules/graphql && ../../coder/vendor/bin/phpcs -p
        if: ${{ matrix.phpstan == '1' }}
        run: cd modules/graphql && ../../vendor/bin/phpcs -p
+1 −1
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@ namespace Drupal\graphql_composable\Plugin\GraphQL\DataProducer;

use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
use Drupal\graphql_composable\GraphQL\Response\ArticleResponse;
use Drupal\node\Entity\Node;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;

/**
 * Creates a new article entity.
+4 −4
Original line number Diff line number Diff line
@@ -9,20 +9,20 @@ use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\graphql\GraphQL\Execution\ExecutionResult as CacheableExecutionResult;
use Drupal\graphql\GraphQL\Execution\FieldContext;
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
use GraphQL\Error\DebugFlag;
use GraphQL\Server\OperationParams;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use GraphQL\Server\ServerConfig;
use Drupal\graphql\GraphQL\ResolverRegistryInterface;
use Drupal\graphql\GraphQL\Utility\DeferredUtility;
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
use Drupal\graphql\Plugin\SchemaPluginInterface;
use GraphQL\Error\DebugFlag;
use GraphQL\Error\Error;
use GraphQL\Error\FormattedError;
use GraphQL\Executor\Executor;
use GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter;
use GraphQL\Language\AST\DocumentNode;
use GraphQL\Server\Helper;
use GraphQL\Server\OperationParams;
use GraphQL\Server\ServerConfig;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Validator\DocumentValidator;
use GraphQL\Validator\Rules\DisableIntrospection;
+1 −1
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@

namespace Drupal\graphql\Event;

use Drupal\Component\EventDispatcher\Event;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use GraphQL\Executor\ExecutionResult;
use Drupal\Component\EventDispatcher\Event;

/**
 * Represents an event that is triggered before and after a GraphQL operation.
+1 −1
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ namespace Drupal\graphql\EventSubscriber;

use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\graphql\Event\OperationEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use GraphQL\Error\Error;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Save persisted queries to cache.
Loading