Skip to content
Snippets Groups Projects
Commit 2328e14a authored by Elias Häußler's avatar Elias Häußler Committed by Stefan Bürk
Browse files

[TASK] Add iterable types to methods in `TypoLinkCodecService`

This patch adds iterable types to parameters and return types in
methods of `TypoLinkCodecService` leading to a better DX.

Resolves: #98643
Releases: main, 11.5
Change-Id: Id4d42ec28ae49fdd3cf40322c8563d7c5827426d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76160


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 7d4efa38
Branches
Tags
No related merge requests found
......@@ -37,7 +37,7 @@ class TypoLinkCodecService
/**
* Encode TypoLink parts to a single string
*
* @param array $typoLinkParts Array with keys url and optionally any of target, class, title, additionalParams
* @param array{url?: string, target?: string, class?: string, title?: string, additionalParams?: string} $typoLinkParts
* @return string Returns a correctly encoded TypoLink string
*/
public function encode(array $typoLinkParts)
......@@ -73,7 +73,7 @@ class TypoLinkCodecService
* Decodes a TypoLink string into its parts
*
* @param string $typoLink The properly encoded TypoLink string
* @return array Associative array of TypoLink parts with the keys url, target, class, title, additionalParams
* @return array{url: string, target: string, class: string, title: string, additionalParams: string}
*/
public function decode($typoLink)
{
......@@ -81,7 +81,7 @@ class TypoLinkCodecService
if ($typoLink !== '') {
$parts = str_replace(['\\\\', '\\"'], ['\\', '"'], str_getcsv($typoLink, static::$partDelimiter));
} else {
$parts = '';
$parts = [];
}
// The order of the entries is crucial!!
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment