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

test(phpstan): Ignore image derivative test warnings for now (#1368)

parent ce2bc1f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ jobs:
        # Pin the exact Coder version to upgrade manually when we want to.
        run: |
          composer --no-interaction --no-progress require \
            phpstan/phpstan:^1.10.32 \
            phpstan/phpstan:^1.10.38 \
            mglaman/phpstan-drupal:^1.1.2 \
            phpstan/phpstan-deprecation-rules:^1.0.0 \
            jangregor/phpstan-prophecy:^1.0.0 \
+0 −10
Original line number Diff line number Diff line
@@ -12,9 +12,6 @@ parameters:
  # Not sure we can specify generic types properly with Drupal coding standards
  # yet, disable for now.
  checkGenericClassInNonGenericObjectType: false
  # Sometimes we have a mismatch between local execution and CI, we don't care
  # about ignored errors that are not triggered.
  reportUnmatchedIgnoredErrors: false
  excludePaths:
    # Exclude the RouteLoad producer because the redirect module is not D10
    # compatible so we are not downloading it.
@@ -54,10 +51,3 @@ parameters:
      message: "#^Method Drupal\\\\graphql\\\\Entity\\\\ServerInterface\\:\\:removePersistedQueryInstance\\(\\) has no return type specified\\.$#"
      count: 1
      path: src/Entity/ServerInterface.php

    # We already use the ProphecyTrait, so not sure why PHPStan complains about
    # this?
    - """
      #^Call to deprecated method prophesize\\(\\) of class Drupal\\\\Tests\\\\graphql\\\\Kernel\\\\GraphQLTestBase\\:
      https\\://github\\.com/sebastianbergmann/phpunit/issues/4141$#
    """
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class ImageDerivative extends DataProducerPluginBase implements ContainerFactory
   * @return array|null
   */
  public function resolve(FileInterface $entity = NULL, $style, RefinableCacheableDependencyInterface $metadata) {
    // Return if we dont have an entity.
    // Return if we don't have an entity.
    if (!$entity) {
      return NULL;
    }
+3 −0
Original line number Diff line number Diff line
@@ -62,7 +62,10 @@ class ImageDerivativeTest extends GraphQLTestBase {

    $this->file->method('getFileUri')->willReturn($this->fileUri);
    $this->file->method('access')->willReturn((new AccessResultAllowed())->addCacheTags(['test_tag']));
    // @todo Remove hard-coded properties and only rely on image factory.
    // @phpstan-ignore-next-line
    @$this->file->width = 600;
    // @phpstan-ignore-next-line
    @$this->file->height = 400;

    $this->style = ImageStyle::create(['name' => 'test_style']);