resolveResourceValue($value); } if (empty($value)) { return null; } try { if ($value instanceof UriInterface || $value instanceof UriResource) { return HashValue::parse( HashProxy::urls((string)$value)->withType($type)->compile($this->assetsCache) ); } if ($value instanceof SystemResourceInterface) { return HashValue::parse( HashProxy::resource((string)$value)->withType($type)->compile($this->assetsCache) ); } return null; } catch (\Throwable $t) { $this->logger->error('Could not add resource hash: {exceptionMessage}', [ 'value' => $value, 'exceptionMessage' => $t->getMessage(), 'exceptionCode' => $t->getCode(), ]); return null; } } public function resolveResourceValue(string $value): UriInterface|StaticResourceInterface|null { if (PathUtility::hasProtocolAndScheme($value)) { try { return new Uri($value); } catch (\Exception) { return null; } } if (PathUtility::isExtensionPath($value)) { return $this->systemResourceFactory->createResource($value); } return null; } }