1
0
mirror of synced 2025-01-09 18:47:10 +03:00

Minor CS fixes on top of #973

This commit is contained in:
Marco Pivetta 2014-04-14 01:19:32 +02:00
parent eccd8f85bc
commit a87d3e080e
3 changed files with 8 additions and 20 deletions

View File

@ -101,9 +101,7 @@ class AnnotationDriver extends AbstractAnnotationDriver
if ($tableAnnot->indexes !== null) { if ($tableAnnot->indexes !== null) {
foreach ($tableAnnot->indexes as $indexAnnot) { foreach ($tableAnnot->indexes as $indexAnnot) {
$index = array( $index = array('columns' => $indexAnnot->columns);
'columns' => $indexAnnot->columns,
);
if ( ! empty($indexAnnot->flags)) { if ( ! empty($indexAnnot->flags)) {
$index['flags'] = $indexAnnot->flags; $index['flags'] = $indexAnnot->flags;

View File

@ -195,18 +195,14 @@ class XmlDriver extends FileDriver
if (isset($xmlRoot->indexes)) { if (isset($xmlRoot->indexes)) {
$metadata->table['indexes'] = array(); $metadata->table['indexes'] = array();
foreach ($xmlRoot->indexes->index as $indexXml) { foreach ($xmlRoot->indexes->index as $indexXml) {
$columns = explode(',', (string)$indexXml['columns']); $index = array('columns' => explode(',', (string) $indexXml['columns']));
$index = array(
'columns' => $columns
);
if (isset($indexXml['flags'])) { if (isset($indexXml['flags'])) {
$index['flags'] = explode(',', (string)$indexXml['flags']); $index['flags'] = explode(',', (string) $indexXml['flags']);
} }
if (isset($indexXml['name'])) { if (isset($indexXml['name'])) {
$metadata->table['indexes'][(string)$indexXml['name']] = $index; $metadata->table['indexes'][(string) $indexXml['name']] = $index;
} else { } else {
$metadata->table['indexes'][] = $index; $metadata->table['indexes'][] = $index;
} }

View File

@ -207,20 +207,14 @@ class YamlDriver extends FileDriver
} }
if (is_string($indexYml['columns'])) { if (is_string($indexYml['columns'])) {
$columns = explode(',', $indexYml['columns']); $index = array('columns' => array_map('trim', explode(',', $indexYml['columns'])));
$columns = array_map('trim', $columns);
} else { } else {
$columns = $indexYml['columns']; $index = array('columns' => $indexYml['columns']);
} }
$index = array(
'columns' => $columns
);
if(isset($indexYml['flags'])) { if (isset($indexYml['flags'])) {
if (is_string($indexYml['flags'])) { if (is_string($indexYml['flags'])) {
$flags = explode(',', $indexYml['flags']); $index['flags'] = array_map('trim', explode(',', $indexYml['flags']));
$index['flags'] = array_map('trim', $flags);
} else { } else {
$index['flags'] = $indexYml['flags']; $index['flags'] = $indexYml['flags'];
} }