Skip to content

Commit f55a29d

Browse files
authored
test(phpstan): Ignore image derivative test warnings for now (#1368)
1 parent ce2bc1f commit f55a29d

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
# Pin the exact Coder version to upgrade manually when we want to.
102102
run: |
103103
composer --no-interaction --no-progress require \
104-
phpstan/phpstan:^1.10.32 \
104+
phpstan/phpstan:^1.10.38 \
105105
mglaman/phpstan-drupal:^1.1.2 \
106106
phpstan/phpstan-deprecation-rules:^1.0.0 \
107107
jangregor/phpstan-prophecy:^1.0.0 \

phpstan.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ parameters:
1212
# Not sure we can specify generic types properly with Drupal coding standards
1313
# yet, disable for now.
1414
checkGenericClassInNonGenericObjectType: false
15-
# Sometimes we have a mismatch between local execution and CI, we don't care
16-
# about ignored errors that are not triggered.
17-
reportUnmatchedIgnoredErrors: false
1815
excludePaths:
1916
# Exclude the RouteLoad producer because the redirect module is not D10
2017
# compatible so we are not downloading it.
@@ -54,10 +51,3 @@ parameters:
5451
message: "#^Method Drupal\\\\graphql\\\\Entity\\\\ServerInterface\\:\\:removePersistedQueryInstance\\(\\) has no return type specified\\.$#"
5552
count: 1
5653
path: src/Entity/ServerInterface.php
57-
58-
# We already use the ProphecyTrait, so not sure why PHPStan complains about
59-
# this?
60-
- """
61-
#^Call to deprecated method prophesize\\(\\) of class Drupal\\\\Tests\\\\graphql\\\\Kernel\\\\GraphQLTestBase\\:
62-
https\\://github\\.com/sebastianbergmann/phpunit/issues/4141$#
63-
"""

src/Plugin/GraphQL/DataProducer/Entity/Fields/Image/ImageDerivative.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(
8989
* @return array|null
9090
*/
9191
public function resolve(FileInterface $entity = NULL, $style, RefinableCacheableDependencyInterface $metadata) {
92-
// Return if we dont have an entity.
92+
// Return if we don't have an entity.
9393
if (!$entity) {
9494
return NULL;
9595
}

tests/src/Kernel/DataProducer/Entity/Fields/Image/ImageDerivativeTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public function setUp(): void {
6262

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

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

0 commit comments

Comments
 (0)