Skip to content

Commit

Permalink
IBX-6017: Updated the getTranslatedContentNameByVersionInfo method
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Jul 19, 2023
1 parent d8db127 commit b495c5c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions eZ/Publish/Core/Helper/TranslationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,12 @@ public function getTranslatedContentName(Content $content, $forcedLanguage = nul

/**
* Returns content name, translated, from a VersionInfo object.
* By default this method uses prioritized languages, unless $forcedLanguage is provided.
*
* @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo
* @param string $forcedLanguage
*
* @return string
* By default, this method uses prioritized languages, unless $forcedLanguage is provided.
*/
public function getTranslatedContentNameByVersionInfo(VersionInfo $versionInfo, $forcedLanguage = null)
{
public function getTranslatedContentNameByVersionInfo(
VersionInfo $versionInfo,
?string $forcedLanguage = null
): string {
foreach ($this->getLanguages($forcedLanguage) as $lang) {
$translatedName = $versionInfo->getName($lang);
if ($translatedName !== null) {
Expand Down

0 comments on commit b495c5c

Please sign in to comment.