summaryrefslogtreecommitdiffstats
path: root/src/Components/PartitionDefinition.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Components/PartitionDefinition.php')
-rw-r--r--src/Components/PartitionDefinition.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/Components/PartitionDefinition.php b/src/Components/PartitionDefinition.php
index 3e3c1d8..59b34cb 100644
--- a/src/Components/PartitionDefinition.php
+++ b/src/Components/PartitionDefinition.php
@@ -203,19 +203,18 @@ class PartitionDefinition extends Component
{
if (is_array($component)) {
return "(\n" . implode(",\n", $component) . "\n)";
- } else {
- if ($component->isSubpartition) {
- return trim('SUBPARTITION ' . $component->name . ' ' . $component->options);
- } else {
- $subpartitions = empty($component->subpartitions)
- ? '' : ' ' . self::build($component->subpartitions);
-
- return trim(
- 'PARTITION ' . $component->name
- . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ')
- . $component->options . $subpartitions
- );
- }
}
+
+ if ($component->isSubpartition) {
+ return trim('SUBPARTITION ' . $component->name . ' ' . $component->options);
+ }
+
+ $subpartitions = empty($component->subpartitions) ? '' : ' ' . self::build($component->subpartitions);
+
+ return trim(
+ 'PARTITION ' . $component->name
+ . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ')
+ . $component->options . $subpartitions
+ );
}
}