From aa3d6335519574549bfa6d307e23090899815082 Mon Sep 17 00:00:00 2001 From: Kiel Date: Fri, 26 Jul 2024 01:23:19 -0700 Subject: [PATCH] Document Exceptions in AssetRepository URL Functions The `updateDesignParams()` function has the capacity to throw the `UnexpectedValueException` but this is not documented in either of the functions that call it. Additionally, the `createAsset()` function has the potential to throw a `LocalizedException` which is not documented by either of the functions that make use of it. --- lib/internal/Magento/Framework/View/Asset/Repository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/internal/Magento/Framework/View/Asset/Repository.php b/lib/internal/Magento/Framework/View/Asset/Repository.php index c237231cf283a..4693d47823dd7 100644 --- a/lib/internal/Magento/Framework/View/Asset/Repository.php +++ b/lib/internal/Magento/Framework/View/Asset/Repository.php @@ -214,6 +214,7 @@ private function getDefaultParameter($name) * @param array $params * @return File * @throws LocalizedException + * @throws \UnexpectedValueException */ public function createAsset($fileId, array $params = []) { @@ -254,6 +255,7 @@ public function createAsset($fileId, array $params = []) * Get current context for static view files * * @return \Magento\Framework\View\Asset\File\FallbackContext + * @throws \UnexpectedValueException */ public function getStaticViewFileContext() { @@ -413,6 +415,8 @@ public function createRemoteAsset($url, $contentType) * * @param string $fileId * @return string + * @throws LocalizedException + * @throws \UnexpectedValueException */ public function getUrl($fileId) { @@ -428,6 +432,8 @@ public function getUrl($fileId) * @param string $fileId * @param array $params * @return string + * @throws LocalizedException + * @throws \UnexpectedValueException * @see getUrl() */ public function getUrlWithParams($fileId, array $params)