Skip to content

Commit

Permalink
test(phpstan): Ignore image derivative test warnings for now (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
klausi authored Oct 15, 2023
1 parent ce2bc1f commit f55a29d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 0 additions & 10 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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$#
"""
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct(
* @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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ public function setUp(): void {

$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']);
Expand Down

0 comments on commit f55a29d

Please sign in to comment.