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 13, 2025
1 parent 43622ce commit 05e67f9
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 26 deletions.
10 changes: 5 additions & 5 deletions src/DataObject/Data/Adapter/ClassificationStoreAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
*/
#[AutoconfigureTag(DataAdapterLoaderInterface::ADAPTER_TAG)]
final readonly class ClassificationStoreAdapter implements
SetterDataInterface, DataNormalizerInterface, DataInheritanceInterface
SetterDataInterface,
DataNormalizerInterface,
DataInheritanceInterface
{
use ValidateFieldTypeTrait;

Expand Down Expand Up @@ -125,8 +127,7 @@ public function getFieldInheritance(
Data $fieldDefinition,
string $key,
?FieldContextData $contextData = null
): array
{
): array {
$inheritedData = [];
if (!$fieldDefinition instanceof ClassificationstoreDefinition) {
return [];
Expand Down Expand Up @@ -359,8 +360,7 @@ private function getOriginId(
int $groupId,
int $groupKeyId,
string $language
): int
{
): int {
$data = $this->getValidFieldValue($object, $key)
->getLocalizedKeyValue($groupId, $groupKeyId, $language, true, true);

Expand Down
8 changes: 4 additions & 4 deletions src/DataObject/Data/Adapter/LocalizedFieldsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DataInheritanceInterface;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DataNormalizerInterface;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\InheritanceData;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\SetterDataInterface;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Service\DataAdapterLoaderInterface;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Service\DataAdapterServiceInterface;
Expand All @@ -48,7 +47,9 @@
*/
#[AutoconfigureTag(DataAdapterLoaderInterface::ADAPTER_TAG)]
final readonly class LocalizedFieldsAdapter implements
SetterDataInterface, DataNormalizerInterface, DataInheritanceInterface
SetterDataInterface,
DataNormalizerInterface,
DataInheritanceInterface
{
use ValidateFieldTypeTrait;

Expand Down Expand Up @@ -155,8 +156,7 @@ public function getFieldInheritance(
Data $fieldDefinition,
string $key,
?FieldContextData $contextData = null
): array
{
): array {
if (!$fieldDefinition instanceof Localizedfields) {
return [];
}
Expand Down
7 changes: 4 additions & 3 deletions src/DataObject/Data/Adapter/ObjectBricksAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
*/
#[AutoconfigureTag(DataAdapterLoaderInterface::ADAPTER_TAG)]
final readonly class ObjectBricksAdapter implements
SetterDataInterface, DataNormalizerInterface, DataInheritanceInterface
SetterDataInterface,
DataNormalizerInterface,
DataInheritanceInterface
{
use ValidateFieldTypeTrait;

Expand Down Expand Up @@ -116,8 +118,7 @@ public function getFieldInheritance(
Data $fieldDefinition,
string $key,
?FieldContextData $contextData = null
): array
{
): array {
$value = $this->getValidFieldValue($object, $key);
if (!$value instanceof Objectbrick) {
return [];
Expand Down
3 changes: 1 addition & 2 deletions src/DataObject/Service/DataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public function setObjectDetailData(
DataObjectFolder|DataObject $dataObject,
Concrete $element,
ClassDefinition $class
): void
{
): void {
$classData = $this->getObjectClassData($class);
$fieldDefinitions = $class->getFieldDefinitions();

Expand Down
1 change: 0 additions & 1 deletion src/DataObject/Service/DataServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace Pimcore\Bundle\StudioBackendBundle\DataObject\Service;

use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\ClassData;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Schema\DataObject;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Schema\Type\DataObjectFolder;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\DatabaseException;
Expand Down
7 changes: 2 additions & 5 deletions src/DataObject/Service/InheritanceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public function __construct(
public function getInheritanceData(
Concrete $object,
array $fieldDefinitions
): array
{
): array {

return $this->dataObjectServiceResolver->useInheritedValues(
false,
Expand All @@ -64,7 +63,6 @@ function () use ($object, $fieldDefinitions) {
);
}


/**
* @throws NotFoundException
*/
Expand Down Expand Up @@ -128,8 +126,7 @@ private function getFieldValue(
Data $fieldDefinition,
string $key,
?FieldContextData $contextData = null
): mixed
{
): mixed {
$fieldKey = $this->getFieldKeyByContext(
$key,
$fieldDefinition,
Expand Down
2 changes: 0 additions & 2 deletions src/DataObject/Service/InheritanceServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

namespace Pimcore\Bundle\StudioBackendBundle\DataObject\Service;

use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\ClassData;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\InheritanceData;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\NotFoundException;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\Concrete;

Expand Down
5 changes: 1 addition & 4 deletions src/DataObject/Util/Trait/ValidateFieldTypeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace Pimcore\Bundle\StudioBackendBundle\DataObject\Util\Trait;

use Exception;
use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\NotFoundException;
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\ClassDefinition\Data\EncryptedField as EncryptedFieldDefinition;
Expand All @@ -34,16 +33,14 @@ private function validateEncryptedField(Data $fieldDefinition, mixed $value): bo
return !($fieldDefinition instanceof EncryptedFieldDefinition && (!$value instanceof EncryptedField));
}


/**
* @throws NotFoundException
*/
private function getValidFieldValue(
Concrete $object,
string $key,
?string $language = null
): mixed
{
): mixed {
try {
return $object->get($key, $language);
} catch (Exception) {
Expand Down

0 comments on commit 05e67f9

Please sign in to comment.