diff --git a/etc/_scripts/phpstan b/etc/_scripts/phpstan index f5863d22dc..d60c126c2e 100755 --- a/etc/_scripts/phpstan +++ b/etc/_scripts/phpstan @@ -4,4 +4,4 @@ set -e echo "RUNNING PHPSTAN" bin/console cache:warmup --env=dev -vendor/bin/phpstan analyse -c phpstan.travis.neon src -l 3 +vendor/bin/phpstan analyse -c phpstan.neon src -l 3 diff --git a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/Document/Select.php b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/Document/Select.php index 7ada51439d..f6bb5ff44f 100644 --- a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/Document/Select.php +++ b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/Document/Select.php @@ -117,14 +117,6 @@ public function getOptions() return $options; } - /** - * {@inheritdoc} - */ - public function isEmpty() - { - return !$this->resource; - } - /** * {@inheritdoc} */ @@ -142,7 +134,7 @@ public function setDataFromResource($data) } /** - * {@inheritdoc} + * @return array */ public function getForWebserviceExport($document = null, $params = []) { diff --git a/src/CoreShop/Component/Pimcore/DataObject/ClassDefinitionFieldReNamer.php b/src/CoreShop/Component/Pimcore/DataObject/ClassDefinitionFieldReNamer.php index b493ca8cb3..59fbedd2d2 100644 --- a/src/CoreShop/Component/Pimcore/DataObject/ClassDefinitionFieldReNamer.php +++ b/src/CoreShop/Component/Pimcore/DataObject/ClassDefinitionFieldReNamer.php @@ -141,41 +141,39 @@ protected function getRenameQueries() $columnRenames = []; foreach ($queryTables as $queryTable) { - if (!method_exists($fieldDefinition, 'getQueryColumnType')) { - continue; - } - - if (is_array($fieldDefinition->getQueryColumnType())) { - foreach ($fieldDefinition->getQueryColumnType() as $fkey => $fvalue) { - $columnName = $key . '__' . $fkey; - $newColumnName = $key . '__' . $this->newFieldName; - - $columnRenames[$queryTable][$columnName] = $newColumnName; + if ($fieldDefinition instanceof Data\QueryResourcePersistenceAwareInterface) { + if (is_array($fieldDefinition->getQueryColumnType())) { + foreach ($fieldDefinition->getQueryColumnType() as $fkey => $fvalue) { + $columnName = $key.'__'.$fkey; + $newColumnName = $key.'__'.$this->newFieldName; + + $columnRenames[$queryTable][$columnName] = $newColumnName; + } } - } - else { - if ($fieldDefinition->getQueryColumnType()) { - $columnRenames[$queryTable][$key] = $this->newFieldName; + + if (!is_array($fieldDefinition->getQueryColumnType())) { + if ($fieldDefinition->getQueryColumnType()) { + $columnRenames[$queryTable][$key] = $this->newFieldName; + } } } } foreach ($storeTables as $storeTable) { - if (!method_exists($fieldDefinition, 'getColumnType')) { - continue; - } - - if (!$fieldDefinition->isRelationType() && is_array($fieldDefinition->getColumnType())) { - foreach ($fieldDefinition->getColumnType() as $fkey => $fvalue) { - $columnName = $key . '__' . $fkey; - $newColumnName = $key . '__' . $this->newFieldName; - - $columnRenames[$storeTable][$columnName] = $newColumnName; + if ($fieldDefinition instanceof Data\ResourcePersistenceAwareInterface) { + if (!$fieldDefinition->isRelationType() && is_array($fieldDefinition->getColumnType())) { + foreach ($fieldDefinition->getColumnType() as $fkey => $fvalue) { + $columnName = $key.'__'.$fkey; + $newColumnName = $key.'__'.$this->newFieldName; + + $columnRenames[$storeTable][$columnName] = $newColumnName; + } } - } - else { - if ($fieldDefinition->getColumnType()) { - $columnRenames[$storeTable][$key] = $this->newFieldName; + + if (!is_array($fieldDefinition->getColumnType())) { + if ($fieldDefinition->getColumnType() && !$fieldDefinition->isRelationType()) { + $columnRenames[$storeTable][$key] = $this->newFieldName; + } } } }