From 5f25d14dc414abe6d25b196468ac84e086d1e4f4 Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Thu, 30 Mar 2023 08:56:25 +0200 Subject: [PATCH] Fix: PHPStan --- phpstan-baseline.neon | 15 +++++++++++++++ src/DependencyInjection/Configuration.php | 4 +++- src/GraphQL/Query/Operator/Thumbnail.php | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ba129072..6d0d88d8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5,6 +5,21 @@ parameters: count: 3 path: src/DependencyInjection/Configuration.php + - + message: "#Call to static method addConfigLocationWithWriteTargetNodes() on an unknown class#" + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: "#Call to static method getConfigNodeFromSymfonyTree() on an unknown class#" + count: 1 + path: src/DependencyInjection/PimcoreDataHubExtension.php + + - + message: "#Call to static method getSymfonyConfigFiles() on an unknown class#" + count: 1 + path: src/DependencyInjection/PimcoreDataHubExtension.php + - message: "#^Constructor of class Pimcore\\\\Bundle\\\\DataHubBundle\\\\GraphQL\\\\AssetType\\\\AssetFolderType has an unused parameter \\$config\\.$#" count: 1 diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 10d40665..9b59be0a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -47,7 +47,9 @@ public function getConfigTreeBuilder() $this->addConfigurationsNode($rootNode); $this->addSupportedTypes($rootNode); - ConfigurationHelper::addConfigLocationWithWriteTargetNodes($rootNode, ['data_hub']); + if(\Pimcore\Version::getMajorVersion() >= 11) { + ConfigurationHelper::addConfigLocationWithWriteTargetNodes($rootNode, ['data_hub']); + } return $treeBuilder; } diff --git a/src/GraphQL/Query/Operator/Thumbnail.php b/src/GraphQL/Query/Operator/Thumbnail.php index 08a26f93..14ce1177 100644 --- a/src/GraphQL/Query/Operator/Thumbnail.php +++ b/src/GraphQL/Query/Operator/Thumbnail.php @@ -64,7 +64,7 @@ public function getLabeledValue($element, ResolveInfo $resolveInfo = null) if ($childResult->value instanceof Asset\Image || $childResult->value instanceof Asset\Video) { $childValue = $result->value = $childResult->value; $thumbnail = $childValue->getThumbnail($this->thumbnailConfig, false); - $result->value = $thumbnail->getPath(false); + $result->value = $thumbnail->getPath(); } }