diff --git a/src/DataObject/Data/Adapter/AdvancedManyToManyRelationAdapter.php b/src/DataObject/Data/Adapter/AdvancedManyToManyRelationAdapter.php index dfbc946f..c79f917c 100644 --- a/src/DataObject/Data/Adapter/AdvancedManyToManyRelationAdapter.php +++ b/src/DataObject/Data/Adapter/AdvancedManyToManyRelationAdapter.php @@ -27,8 +27,6 @@ use Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyRelation; use Pimcore\Model\DataObject\Concrete; use Pimcore\Model\DataObject\Data\ElementMetadata; -use Pimcore\Model\DataObject\Data\ObjectMetadata; -use Pimcore\Model\Element\ElementInterface; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use function is_array; diff --git a/src/DataObject/Data/Adapter/BooleanAdapter.php b/src/DataObject/Data/Adapter/BooleanAdapter.php index d986808b..3eb4d4bc 100644 --- a/src/DataObject/Data/Adapter/BooleanAdapter.php +++ b/src/DataObject/Data/Adapter/BooleanAdapter.php @@ -19,7 +19,6 @@ use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData; use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\SetterDataInterface; use Pimcore\Bundle\StudioBackendBundle\DataObject\Service\DataAdapterLoaderInterface; -use Pimcore\Bundle\StudioBackendBundle\DataObject\Util\Trait\DefaultSetterValueTrait; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Concrete; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; diff --git a/src/DataObject/Data/Adapter/ClassificationStoreAdapter.php b/src/DataObject/Data/Adapter/ClassificationStoreAdapter.php index c85ff2bb..2d503ab5 100644 --- a/src/DataObject/Data/Adapter/ClassificationStoreAdapter.php +++ b/src/DataObject/Data/Adapter/ClassificationStoreAdapter.php @@ -82,12 +82,12 @@ public function getDataForSetter( $store = $data[$key]; $activeGroups = $store['activeGroups'] ?? []; - if(empty($activeGroups)) { + if (empty($activeGroups)) { return null; } $groupCollectionMapping = $store['groupCollectionMapping'] ?? []; $container = $this->getContainer($element, $key, $contextData); - if(!empty($groupCollectionMapping)) { + if (!empty($groupCollectionMapping)) { $this->setMapping($container, $store['activeGroups'], $store['groupCollectionMapping']); } unset($store['activeGroups'], $store['groupCollectionMapping']); @@ -186,8 +186,7 @@ private function setMapping( Classificationstore $container, array $activeGroups, array $groupCollectionMapping - ): void - { + ): void { $correctedMapping = array_filter($groupCollectionMapping, static function ($groupId) use ($activeGroups) { return isset($activeGroups[$groupId]) && $activeGroups[$groupId]; }, ARRAY_FILTER_USE_KEY); diff --git a/src/DataObject/Data/Adapter/DateRangeAdapter.php b/src/DataObject/Data/Adapter/DateRangeAdapter.php index 1f193fca..ff89daa3 100644 --- a/src/DataObject/Data/Adapter/DateRangeAdapter.php +++ b/src/DataObject/Data/Adapter/DateRangeAdapter.php @@ -25,6 +25,7 @@ use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Concrete; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; +use function count; use function is_array; /** @@ -57,7 +58,7 @@ public function normalize(mixed $value, Data $fieldDefinition): array return [ $value->getStartDate(), - $value->getEndDate() + $value->getEndDate(), ]; } diff --git a/src/DataObject/Data/Adapter/GeoBoundsAdapter.php b/src/DataObject/Data/Adapter/GeoBoundsAdapter.php index ae0623c9..c0a449ff 100644 --- a/src/DataObject/Data/Adapter/GeoBoundsAdapter.php +++ b/src/DataObject/Data/Adapter/GeoBoundsAdapter.php @@ -38,7 +38,7 @@ private const string SOUTH_WEST = 'southWest'; private const array DIRECTIONS = [self::NORTH_EAST, self::SOUTH_WEST]; - + public function getDataForSetter( Concrete $element, Data $fieldDefinition, @@ -63,7 +63,7 @@ public function getDataForSetter( ) ); } - + private function validateBounds(array $data): bool { foreach (self::DIRECTIONS as $direction) { diff --git a/src/DataObject/Data/Adapter/ObjectBricksAdapter.php b/src/DataObject/Data/Adapter/ObjectBricksAdapter.php index fb19f1af..fa32fe79 100644 --- a/src/DataObject/Data/Adapter/ObjectBricksAdapter.php +++ b/src/DataObject/Data/Adapter/ObjectBricksAdapter.php @@ -34,7 +34,6 @@ use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData; use Pimcore\Model\DataObject\Objectbrick\Definition; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; -use function array_key_exists; /** * @internal @@ -72,12 +71,12 @@ public function getDataForSetter( $container = $this->getContainer($element, $key, $fieldDefinition->getName(), $contextData); $brickKeys = array_keys($brickData); - foreach($brickKeys as $brickKey) { + foreach ($brickKeys as $brickKey) { $brick = $this->getBrick($element, $container, $brickKey); $brick->setFieldname($fieldDefinition->getName()); $brickValue = $brickData[$brickKey]; - if($this->checkDeleteBrick($brick, $brickValue)) { + if ($this->checkDeleteBrick($brick, $brickValue)) { continue; } diff --git a/src/DataObject/Data/Adapter/VideoAdapter.php b/src/DataObject/Data/Adapter/VideoAdapter.php index 5d6cd042..006009e0 100644 --- a/src/DataObject/Data/Adapter/VideoAdapter.php +++ b/src/DataObject/Data/Adapter/VideoAdapter.php @@ -56,7 +56,7 @@ public function getDataForSetter( } $type = $adapterData['type'] ?? null; - if($type === ElementTypes::TYPE_ASSET) { + if ($type === ElementTypes::TYPE_ASSET) { $adapterData['data'] = $this->resolveAssetIfNeeded($type, $adapterData['data']['fullPath']); $adapterData['poster'] = $this->getAssetByPath($adapterData['poster'] ?? null); } diff --git a/src/DataObject/Util/Trait/RelationMetadataTrait.php b/src/DataObject/Util/Trait/RelationMetadataTrait.php index b059efb1..6ff2f19d 100644 --- a/src/DataObject/Util/Trait/RelationMetadataTrait.php +++ b/src/DataObject/Util/Trait/RelationMetadataTrait.php @@ -29,8 +29,7 @@ public function addRelationMetadata( ElementInterface $object, array $relationData, ObjectMetadata|ElementMetadata $metadata - ): ObjectMetadata|ElementMetadata - { + ): ObjectMetadata|ElementMetadata { $metadata->_setOwner($object); $metadata->_setOwnerFieldname($metadata->getFieldname()); diff --git a/src/Util/Constant/DataObject/Coordinates.php b/src/Util/Constant/DataObject/Coordinates.php index a7004d70..b106d7c5 100644 --- a/src/Util/Constant/DataObject/Coordinates.php +++ b/src/Util/Constant/DataObject/Coordinates.php @@ -22,6 +22,5 @@ enum Coordinates: string use EnumToValueArrayTrait; case LATITUDE = 'latitude'; - case LONGITUDE = 'longitude'; }