Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STAN] fixes #1239

Merged
merged 4 commits into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion etc/_scripts/phpstan
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ public function getOptions()
return $options;
}

/**
* {@inheritdoc}
*/
public function isEmpty()
{
return !$this->resource;
}

/**
* {@inheritdoc}
*/
Expand All @@ -142,7 +134,7 @@ public function setDataFromResource($data)
}

/**
* {@inheritdoc}
* @return array
*/
public function getForWebserviceExport($document = null, $params = [])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down