From f4b761df8aa6f9a955ae02fa0f883423f5215ee9 Mon Sep 17 00:00:00 2001 From: Pimcore Bot Date: Tue, 22 Dec 2020 14:57:44 +0100 Subject: [PATCH] Coding Standards Fixer Bot --- .../Migrations/Version20201207132025.php | 1 - .../ProcessUpdateIndexQueueCommand.php | 2 +- .../ElasticSearch/AbstractElasticSearch.php | 16 +++++++--------- .../GridColumnConfig/Operator/AnyGetter.php | 6 +++--- .../GridColumnConfig/Operator/DateFormatter.php | 2 +- .../Operator/FieldCollectionGetter.php | 2 +- .../GridColumnConfig/Operator/PropertyGetter.php | 1 + .../GridColumnConfig/Value/DefaultValue.php | 2 -- .../ClassDefinition/Data/RgbaColor.php | 2 +- .../LanguageTableDoesNotExistException.php | 2 +- 10 files changed, 16 insertions(+), 20 deletions(-) diff --git a/bundles/CoreBundle/Migrations/Version20201207132025.php b/bundles/CoreBundle/Migrations/Version20201207132025.php index 99875cfebe1..efe9fd5276a 100644 --- a/bundles/CoreBundle/Migrations/Version20201207132025.php +++ b/bundles/CoreBundle/Migrations/Version20201207132025.php @@ -7,7 +7,6 @@ class Version20201207132025 extends AbstractPimcoreMigration { - public function doesSqlMigrations(): bool { return false; diff --git a/bundles/EcommerceFrameworkBundle/Command/IndexService/ProcessUpdateIndexQueueCommand.php b/bundles/EcommerceFrameworkBundle/Command/IndexService/ProcessUpdateIndexQueueCommand.php index d5682e68bb0..2163fbb32a0 100644 --- a/bundles/EcommerceFrameworkBundle/Command/IndexService/ProcessUpdateIndexQueueCommand.php +++ b/bundles/EcommerceFrameworkBundle/Command/IndexService/ProcessUpdateIndexQueueCommand.php @@ -162,7 +162,7 @@ protected function getTenantWorkers(array $openTenantList): array // collect all workers from all processed tenants $this->childWorkerList = $this->childWorkerList ?? []; $childWorkerList = []; - foreach(array_merge($this->childWorkerList, $workerList) as $worker) { + foreach (array_merge($this->childWorkerList, $workerList) as $worker) { $childWorkerList[$worker->getTenantConfig()->getTenantName()] = $worker; } $this->childWorkerList = array_values($childWorkerList); diff --git a/bundles/EcommerceFrameworkBundle/IndexService/Worker/ElasticSearch/AbstractElasticSearch.php b/bundles/EcommerceFrameworkBundle/IndexService/Worker/ElasticSearch/AbstractElasticSearch.php index 4cbe910d972..753e579f8de 100644 --- a/bundles/EcommerceFrameworkBundle/IndexService/Worker/ElasticSearch/AbstractElasticSearch.php +++ b/bundles/EcommerceFrameworkBundle/IndexService/Worker/ElasticSearch/AbstractElasticSearch.php @@ -76,7 +76,6 @@ abstract class AbstractElasticSearch extends Worker\ProductCentricBatchProcessin */ protected $indexStoreMetaData = []; - /** * @var int */ @@ -836,12 +835,12 @@ protected function blockIndexWrite(string $indexName) $esClient->indices()->putSettings([ 'index' => $indexName, 'body' => [ - 'index.blocks.write' => true - ] + 'index.blocks.write' => true, + ], ]); $esClient->indices()->refresh([ - 'index' => $indexName + 'index' => $indexName, ]); } } @@ -860,12 +859,12 @@ protected function unblockIndexWrite(string $indexName) $esClient->indices()->putSettings([ 'index' => $indexName, 'body' => [ - 'index.blocks.write' => false - ] + 'index.blocks.write' => false, + ], ]); $esClient->indices()->refresh([ - 'index' => $indexName + 'index' => $indexName, ]); } } @@ -1092,7 +1091,6 @@ public function extractMinimalSynonymFiltersTreeFromIndexSettings(array $indexSe return $indexPart; } - /** * Verify if the index is currently locked. * @@ -1124,7 +1122,7 @@ protected function checkIndexLock(bool $throwException = true): bool protected function activateIndexLock() { - TmpStore::set(self::REINDEXING_LOCK_KEY, 1, null, 60*10); + TmpStore::set(self::REINDEXING_LOCK_KEY, 1, null, 60 * 10); } protected function releaseIndexLock() diff --git a/lib/DataObject/GridColumnConfig/Operator/AnyGetter.php b/lib/DataObject/GridColumnConfig/Operator/AnyGetter.php index 3a60b289d21..862f48a41b4 100644 --- a/lib/DataObject/GridColumnConfig/Operator/AnyGetter.php +++ b/lib/DataObject/GridColumnConfig/Operator/AnyGetter.php @@ -67,7 +67,7 @@ public function getLabeledValue($element) $result->value = null; if ($this->attribute && method_exists($element, $getter)) { $result->value = $element->$getter($this->getParam1()); - } else if($this->attribute && method_exists($element, $fallbackGetter)) { + } elseif ($this->attribute && method_exists($element, $fallbackGetter)) { $result->value = $element->$fallbackGetter($this->getParam1()); } @@ -115,7 +115,7 @@ public function getLabeledValue($element) foreach ($value as $o) { if ($this->attribute && method_exists($o, $getter)) { $subValues[] = $o->$getter($this->getParam1()); - } else if ($this->attribute && method_exists($o, $fallbackGetter)) { + } elseif ($this->attribute && method_exists($o, $fallbackGetter)) { $subValues[] = $o->$fallbackGetter($this->getParam1()); } } @@ -125,7 +125,7 @@ public function getLabeledValue($element) $o = $value; if ($this->attribute && method_exists($o, $getter)) { $resultElementValue = $o->$getter($this->getParam1()); - } else if ($this->attribute && method_exists($o, $fallbackGetter)) { + } elseif ($this->attribute && method_exists($o, $fallbackGetter)) { $resultElementValue = $o->$fallbackGetter($this->getParam1()); } } diff --git a/lib/DataObject/GridColumnConfig/Operator/DateFormatter.php b/lib/DataObject/GridColumnConfig/Operator/DateFormatter.php index 171908127b0..da5552e48f7 100644 --- a/lib/DataObject/GridColumnConfig/Operator/DateFormatter.php +++ b/lib/DataObject/GridColumnConfig/Operator/DateFormatter.php @@ -97,7 +97,7 @@ public function format($theValue) if ($timestamp && $this->format) { return date($this->format, $timestamp); - } else if ($theValue instanceof Carbon) { + } elseif ($theValue instanceof Carbon) { return $theValue->toDateString(); } diff --git a/lib/DataObject/GridColumnConfig/Operator/FieldCollectionGetter.php b/lib/DataObject/GridColumnConfig/Operator/FieldCollectionGetter.php index c9834689f81..0d5d1172046 100644 --- a/lib/DataObject/GridColumnConfig/Operator/FieldCollectionGetter.php +++ b/lib/DataObject/GridColumnConfig/Operator/FieldCollectionGetter.php @@ -58,7 +58,7 @@ public function getLabeledValue($element) $item = $fc->get($this->idx); if ($item) { $itemGetter = 'get' . ucfirst($this->colAttr); - if(method_exists($item, $itemGetter)) { + if (method_exists($item, $itemGetter)) { $value = $item->$itemGetter(); $result->value = $value; $result->isEmpty = false; diff --git a/lib/DataObject/GridColumnConfig/Operator/PropertyGetter.php b/lib/DataObject/GridColumnConfig/Operator/PropertyGetter.php index f15558cb8cf..0b2ba07fab4 100644 --- a/lib/DataObject/GridColumnConfig/Operator/PropertyGetter.php +++ b/lib/DataObject/GridColumnConfig/Operator/PropertyGetter.php @@ -48,6 +48,7 @@ public function getLabeledValue($element) $result = new \stdClass(); $result->label = $this->label; $result->value = $element->getProperty($this->getPropertyName()); + return $result; } diff --git a/lib/DataObject/GridColumnConfig/Value/DefaultValue.php b/lib/DataObject/GridColumnConfig/Value/DefaultValue.php index a0b19cf34f9..c3b5b3807ab 100644 --- a/lib/DataObject/GridColumnConfig/Value/DefaultValue.php +++ b/lib/DataObject/GridColumnConfig/Value/DefaultValue.php @@ -106,7 +106,6 @@ private function getValueForObject($object, $key, $brickType = null, $brickKey = return $result; } - private function getClassificationStoreValueForObject($object, $key) { $keyParts = explode('~', $key); @@ -194,7 +193,6 @@ public function getLabeledValue($element) // key value, ignore for now return $this->getClassificationStoreValueForObject($element, $this->attribute); - } elseif (count($attributeParts) > 1) { $brickType = $attributeParts[0]; $brickKey = $attributeParts[1]; diff --git a/models/DataObject/ClassDefinition/Data/RgbaColor.php b/models/DataObject/ClassDefinition/Data/RgbaColor.php index c6588440b6d..a3c3b710469 100644 --- a/models/DataObject/ClassDefinition/Data/RgbaColor.php +++ b/models/DataObject/ClassDefinition/Data/RgbaColor.php @@ -329,7 +329,7 @@ public function marshal($value, $object = null, $params = []) 'value' => $rgb, 'value2' => $a, ]; - } else if (is_array($value)) { + } elseif (is_array($value)) { return [ 'value' => $value[$this->getName() . '__rgb'], 'value2' => $value[$this->getName() . '__a'], diff --git a/models/DataObject/Localizedfield/LanguageTableDoesNotExistException.php b/models/DataObject/Localizedfield/LanguageTableDoesNotExistException.php index d0f9f5dbe1e..afdd7766807 100644 --- a/models/DataObject/Localizedfield/LanguageTableDoesNotExistException.php +++ b/models/DataObject/Localizedfield/LanguageTableDoesNotExistException.php @@ -1,6 +1,6 @@