diff --git a/phpstan.neon b/phpstan.neon index 01c253538..a0777a0c8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -14,9 +14,6 @@ parameters: - '#\Drupal calls should be avoided in classes, use dependency injection instead#' # new static() is a best practice in Drupal, so we cannot fix that. - "#^Unsafe usage of new static\\(\\)\\.$#" - # Drupal allows object property access to custom fields, so we cannot fix - # that. - - "#^Access to an undefined property Drupal\\\\#" # We forgot to use return type hints on some interfaces, cannot be changed # in stable 4.0. # @todo use return type hints everywhere for 5.0. diff --git a/src/Plugin/GraphQL/DataProducer/Entity/Fields/Image/ImageDerivative.php b/src/Plugin/GraphQL/DataProducer/Entity/Fields/Image/ImageDerivative.php index d2d7449de..8e00464fa 100644 --- a/src/Plugin/GraphQL/DataProducer/Entity/Fields/Image/ImageDerivative.php +++ b/src/Plugin/GraphQL/DataProducer/Entity/Fields/Image/ImageDerivative.php @@ -98,7 +98,9 @@ public function resolve(FileInterface $entity = NULL, $style, RefinableCacheable $metadata->addCacheableDependency($access); if ($access->isAllowed() && $image_style = ImageStyle::load($style)) { + // @phpstan-ignore-next-line $width = $entity->width; + // @phpstan-ignore-next-line $height = $entity->height; if (empty($width) || empty($height)) { diff --git a/tests/src/Traits/MockingTrait.php b/tests/src/Traits/MockingTrait.php index 85f3a74a8..4b8dd2b83 100644 --- a/tests/src/Traits/MockingTrait.php +++ b/tests/src/Traits/MockingTrait.php @@ -106,7 +106,7 @@ protected function setUpSchema($schema, $id = 'test', array $values = []): void protected function createTestServer($schema, $endpoint, array $values = []): void { $this->server = Server::create([ 'schema' => $schema, - 'name' => $this->randomGenerator->name(), + 'name' => $this->randomMachineName(), 'endpoint' => $endpoint, ] + $values);