Skip to content

Commit

Permalink
Shorten lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Mar 5, 2024
1 parent 6068794 commit 6d47500
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Security/Trait/PublicTranslationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ private function voteOnTranslation(InputBag $payload): bool
return false;
}

$nonPublicTranslations = array_diff($parameters[self::ARRAY_KEYS_INDEX], PublicTranslations::PUBLIC_KEYS);
$nonPublicTranslations = array_diff(
$parameters[self::ARRAY_KEYS_INDEX],
PublicTranslations::PUBLIC_KEYS
);

if (!empty($nonPublicTranslations)) {
throw new NonPublicTranslationException(sprintf('You have requested non public keys: %s', implode(',', $nonPublicTranslations)));
throw new NonPublicTranslationException(
sprintf(
'You have requested non public keys: %s',
implode(',', $nonPublicTranslations)
)
);
}

return true;
Expand Down

0 comments on commit 6d47500

Please sign in to comment.