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 17, 2025
1 parent 6b29235 commit b33290a
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/DataObject/Data/Adapter/BooleanAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/DataObject/Data/Adapter/ClassificationStoreAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/DataObject/Data/Adapter/DateRangeAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -57,7 +58,7 @@ public function normalize(mixed $value, Data $fieldDefinition): array

return [
$value->getStartDate(),
$value->getEndDate()
$value->getEndDate(),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/DataObject/Data/Adapter/GeoBoundsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -63,7 +63,7 @@ public function getDataForSetter(
)
);
}

private function validateBounds(array $data): bool
{
foreach (self::DIRECTIONS as $direction) {
Expand Down
5 changes: 2 additions & 3 deletions src/DataObject/Data/Adapter/ObjectBricksAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/DataObject/Data/Adapter/VideoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/DataObject/Util/Trait/RelationMetadataTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
1 change: 0 additions & 1 deletion src/Util/Constant/DataObject/Coordinates.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ enum Coordinates: string
use EnumToValueArrayTrait;

case LATITUDE = 'latitude';

case LONGITUDE = 'longitude';
}

0 comments on commit b33290a

Please sign in to comment.