From a87d3e080e7f4d391b338ee27d4e73aee15b3c45 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 14 Apr 2014 01:19:32 +0200 Subject: [PATCH] Minor CS fixes on top of #973 --- .../ORM/Mapping/Driver/AnnotationDriver.php | 4 +--- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 10 +++------- lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 14 ++++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index fbd818d2b..3f46e2c95 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -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; diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index a66531e3c..e08ee7ae6 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -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; } diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 2b8a2ce1c..2772913cc 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -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']; }