Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackbitDevs authored and github-actions[bot] committed Sep 16, 2024
1 parent 94b8dec commit 39ea340
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Controller/Admin/DataObject/DataObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static function (Task $task) {

try {
$this->getDataForObject($object, $objectFromVersion);
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$object = $objectFromDatabase;
$this->getDataForObject($object, false);
}
Expand Down Expand Up @@ -1345,7 +1345,7 @@ public function saveAction(Request $request): JsonResponse
if ($request->get('data')) {
try {
$this->applyChanges($object, $this->decodeJson($request->get('data')));
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$this->applyChanges($objectFromDatabase, $this->decodeJson($request->get('data')));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function doGetGridColumnConfig(Request $request, Config $config, bool $is
$setAsFavourite = $savedGridConfig->isSetAsFavourite();
$saveFilters = $savedGridConfig->isSaveFilters();

foreach($gridConfig['columns'] as &$column) {
foreach ($gridConfig['columns'] as &$column) {
if (array_key_exists('isOperator', $column) && $column['isOperator']) {
$colAttributes = &$column['fieldConfig']['attributes'];
SecurityHelper::convertHtmlSpecialCharsArrayKeys($colAttributes, ['label', 'attribute', 'param1']);
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public function getExportJobsAction(Request $request, GridHelperService $gridHel
//prepare fields
$fieldnames = [];
$fields = json_decode($allParams['fields'][0], true);
foreach($fields as $field) {
foreach ($fields as $field) {
$fieldnames[] = $field['key'];
}
$allParams['fields'] = $fieldnames;
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/ElementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public function getRequiresDependenciesAction(Request $request): JsonResponse
'requires' => [], // Initialize 'requires' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiresForFrontend($elements);
$result['total'] = count($result['requires']);

Expand Down Expand Up @@ -762,7 +762,7 @@ public function getRequiredByDependenciesAction(Request $request): JsonResponse
'requiredBy' => [], // Initialize 'requiredBy' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiredByPathForFrontend($elements);
$result['total'] = count($result['requiredBy']);

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function jsonTranslationsSystemAction(Request $request, TranslatorInterfa
public function scriptProxyAction(Request $request): Response
{
$storageFile = $request->get('storageFile');
if(!$storageFile) {
if (!$storageFile) {
throw new \InvalidArgumentException('The parameter storageFile is required');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ protected function getGridFilterCondition(Request $request, string $tableName, b
];
}

if(!empty($conditionFilters)) {
if (!empty($conditionFilters)) {
$conditions = [];
$params = [];
foreach($conditionFilters as $conditionFilter) {
foreach ($conditionFilters as $conditionFilter) {
$conditions[] = $conditionFilter['condition'];
$params[$conditionFilter['field']] = $conditionFilter['value'];
}
Expand Down
6 changes: 3 additions & 3 deletions src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,10 @@ public function prepareListingForGrid(array $requestParams, string $requestedLan
$orderKey = $list->quoteIdentifier($orderKeyParts[0]).'.'.$list->quoteIdentifier($orderKeyParts[1]);

$brickDefinition = Objectbrick\Definition::getByKey($orderKeyParts[0]);
if($brickDefinition instanceof Objectbrick\Definition) {
if ($brickDefinition instanceof Objectbrick\Definition) {
$brickFieldDefinition = $brickDefinition->getFieldDefinition($orderKeyParts[1]);

if($brickFieldDefinition instanceof ClassDefinition\Data\QuantityValue) {
if ($brickFieldDefinition instanceof ClassDefinition\Data\QuantityValue) {
$orderKey = 'CONCAT('.$list->quoteIdentifier($orderKeyParts[0]).'.'.$list->quoteIdentifier($orderKeyParts[1].'__unit').', '.$list->quoteIdentifier($orderKeyParts[0]).'.'.$list->quoteIdentifier($orderKeyParts[1] . '__value').')';
} elseif ($brickFieldDefinition instanceof ClassDefinition\Data\RgbaColor) {
$orderKey = 'CONCAT('.$list->quoteIdentifier($orderKeyParts[0]).'.'.$list->quoteIdentifier($orderKeyParts[1].'__rgb').', '.$list->quoteIdentifier($orderKeyParts[0]).'.'.$list->quoteIdentifier($orderKeyParts[1].'__a').')';
Expand Down Expand Up @@ -688,7 +688,7 @@ public function prepareListingForGrid(array $requestParams, string $requestedLan
if (isset($requestParams['filter_by_object_type'])) {
if ($requestParams['filter_by_object_type'] === 'only_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_OBJECT]);
} elseif($requestParams['filter_by_object_type'] === 'only_variant_objects') {
} elseif ($requestParams['filter_by_object_type'] === 'only_variant_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_VARIANT]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/PreviewGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function getSitePreviewConfig(Concrete $object): array
$domains = $site->getDomains();
array_unshift($domains, $site->getMainDomain());

if(is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
if (is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
$preSelectedSite = $sitesOptions[$label];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/System/AdminConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function get(): array

// If the read target is settings-store and no data is found there,
// load the data from the container config
if(!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
if (!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
$containerConfig = \Pimcore::getContainer()->getParameter('pimcore_admin.config');
$data[self::BRANDING] = $containerConfig[self::BRANDING];
$data[self::ASSETS] = $containerConfig[self::ASSETS];
Expand Down

0 comments on commit 39ea340

Please sign in to comment.