1
0
mirror of synced 2025-01-09 10:37:09 +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) {
foreach ($tableAnnot->indexes as $indexAnnot) {
$index = array(
'columns' => $indexAnnot->columns,
);
$index = array('columns' => $indexAnnot->columns);
if ( ! empty($indexAnnot->flags)) {
$index['flags'] = $indexAnnot->flags;

View File

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

View File

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