Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
subiabre committed Jan 15, 2025
1 parent 825c319 commit e0ba10b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Entity/Trait/LocalizedContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function removeLocale(string $locale): static
return $this;
}


public function setLocales(array $locales): static
{
$this->locales = $locales;
Expand Down
6 changes: 3 additions & 3 deletions src/State/EntityStateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ private function deleteLocalizedContent(
Operation $operation,
array $uriVariables = [],
array $context = [],
array $languages = []
array $languages = [],
) {
$translationRepository = $this->entityManager->getRepository(Translation::class);

if (!\array_diff($data->getLocales(), $languages)) {
throw new \Exception("Cannot leave empty resource. Must have at least one available localization.");
throw new \Exception('Cannot leave empty resource. Must have at least one available localization.');
}

$nonLocalizedLanguages = \array_diff($languages, $data->getLocales());
Expand All @@ -99,7 +99,7 @@ private function deleteLocalizedContent(
$translations = $translationRepository->findBy([
'locale' => $language,
'objectClass' => $data::class,
'foreignKey' => $data->getId()
'foreignKey' => $data->getId(),
]);

foreach ($translations as $translation) {
Expand Down

0 comments on commit e0ba10b

Please sign in to comment.