Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig authored and github-actions[bot] committed Jan 23, 2025
1 parent d4225ca commit cecbee5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/DataObject/Data/Adapter/LocalizedFieldsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ public function getPreviewFieldData(
mixed $value,
Data $fieldDefinition,
array $data
): array
{
): array {
if (!$value instanceof Localizedfield || !$fieldDefinition instanceof Localizedfields) {
return $data;
}
Expand Down Expand Up @@ -227,7 +226,6 @@ public function getPreviewFieldData(
return $data;
}


private function getAllowedLanguages(
Concrete $element,
array $languageData
Expand Down
6 changes: 4 additions & 2 deletions src/Security/Service/LanguageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\ElementPermissions;
use Pimcore\Model\DataObject;
use Pimcore\Model\UserInterface;
use function in_array;
use function sprintf;

/**
* @internal
Expand All @@ -39,8 +41,7 @@ public function getUserAllowedLanguages(
UserInterface $user,
string $permission,
?array $languages = null
): array
{
): array {
if (!in_array($permission, ElementPermissions::LANGUAGE_PERMISSIONS)) {
throw new InvalidArgumentException(sprintf('Invalid permission "%s"', $permission));
}
Expand All @@ -61,6 +62,7 @@ public function getUserAllowedLanguages(
private function getAllLanguages(): array
{
$validLanguages = $this->toolResolver->getValidLanguages();

return array_merge($validLanguages, [MappingProperty::NOT_LOCALIZED_KEY]);
}
}
1 change: 0 additions & 1 deletion src/Security/Service/LanguageServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ public function getUserAllowedLanguages(
string $permission,
?array $languages = null
): array;

}
3 changes: 1 addition & 2 deletions src/Security/Service/SecurityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public function getSpecialDataObjectPermissions(
DataObject $dataObject,
UserInterface $user,
string $permission
): array
{
): array {
/** @var User $user
* Because of isAllowed method in the GDI
* */
Expand Down

0 comments on commit cecbee5

Please sign in to comment.