Skip to content

Commit

Permalink
Fixed translations
Browse files Browse the repository at this point in the history
  • Loading branch information
kisztof committed Oct 31, 2023
1 parent 715c7b2 commit 26e25ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 41 deletions.
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9035,16 +9035,6 @@ parameters:
count: 1
path: src/lib/Tab/Event/TabViewRenderEvent.php

-
message: "#^Method Ibexa\\\\AdminUi\\\\Tab\\\\LocationView\\\\AuthorsTab\\:\\:supplyCreator\\(\\) has parameter \\$parameters with generic class ArrayObject but does not specify its types\\: TKey, TValue$#"
count: 1
path: src/lib/Tab/LocationView/AuthorsTab.php

-
message: "#^Method Ibexa\\\\AdminUi\\\\Tab\\\\LocationView\\\\AuthorsTab\\:\\:supplyLastContributor\\(\\) has parameter \\$parameters with generic class ArrayObject but does not specify its types\\: TKey, TValue$#"
count: 1
path: src/lib/Tab/LocationView/AuthorsTab.php

-
message: "#^Method Ibexa\\\\AdminUi\\\\Tab\\\\LocationView\\\\ContentTab\\:\\:loadContentLanguages\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
18 changes: 7 additions & 11 deletions src/lib/Tab/LocationView/AuthorsTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Ibexa\AdminUi\Tab\LocationView;

use ArrayObject;
use Ibexa\AdminUi\Specification\UserExists;
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
use Ibexa\Contracts\AdminUi\Tab\AbstractEventDispatchingTab;
Expand Down Expand Up @@ -58,9 +57,6 @@ public function getName(): string
return $this->translator->trans('tab.name.authors', [], 'ibexa_locationview');
}

/**
* @return int
*/
public function getOrder(): int
{
return 200;
Expand All @@ -85,22 +81,22 @@ public function getTemplateParameters(array $contextParameters = []): array
$versionInfo = $content->getVersionInfo();
$contentInfo = $versionInfo->getContentInfo();

$viewParameters = new ArrayObject([
$viewParameters = [
'content_info' => $contentInfo,
'version_info' => $versionInfo,
]);
];

$this->supplyCreator($viewParameters, $contentInfo);
$this->supplyLastContributor($viewParameters, $versionInfo);

return array_replace($contextParameters, $viewParameters->getArrayCopy());
return array_replace($contextParameters, $viewParameters);
}

/**
* @param \ArrayObject $parameters
* @param array<string, mixed> $parameters
* @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo
*/
private function supplyLastContributor(ArrayObject $parameters, VersionInfo $versionInfo): void
private function supplyLastContributor(array $parameters, VersionInfo $versionInfo): void
{
$parameters['last_contributor'] = null;
if ((new UserExists($this->userService))->isSatisfiedBy($versionInfo->creatorId)) {
Expand All @@ -109,10 +105,10 @@ private function supplyLastContributor(ArrayObject $parameters, VersionInfo $ver
}

/**
* @param \ArrayObject $parameters
* @param array<string,mixed|null> $parameters
* @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo
*/
private function supplyCreator(ArrayObject $parameters, ContentInfo $contentInfo): void
private function supplyCreator(array $parameters, ContentInfo $contentInfo): void
{
$parameters['creator'] = null;
if ((new UserExists($this->userService))->isSatisfiedBy($contentInfo->ownerId)) {
Expand Down
21 changes: 1 addition & 20 deletions src/lib/Tab/LocationView/DetailsTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ class DetailsTab extends AbstractEventDispatchingTab implements OrderedTabInterf

private PermissionResolver $permissionResolver;

/**
* @param \Twig\Environment $twig
* @param \Symfony\Contracts\Translation\TranslatorInterface $translator
* @param \Ibexa\Contracts\Core\Repository\SectionService $sectionService
* @param \Ibexa\Contracts\Core\Repository\UserService $userService
* @param \Ibexa\AdminUi\UI\Dataset\DatasetFactory $datasetFactory
* @param \Symfony\Component\Form\FormFactoryInterface $formFactory
* @param \Ibexa\Contracts\Core\Repository\PermissionResolver $permissionResolver
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
*/
public function __construct(
Environment $twig,
TranslatorInterface $translator,
Expand All @@ -73,26 +63,17 @@ public function __construct(
$this->permissionResolver = $permissionResolver;
}

/**
* @return string
*/
public function getIdentifier(): string
{
return 'details';
}

/**
* @return string
*/
public function getName(): string
{
/** @Desc("Details") */
/** @Desc("Technical Details") */
return $this->translator->trans('tab.name.details', [], 'ibexa_locationview');
}

/**
* @return int
*/
public function getOrder(): int
{
return 200;
Expand Down

0 comments on commit 26e25ac

Please sign in to comment.