Final code formatting, Travis should pass
authorKiv4h <jeffrey.reichardt@googlemail.com>
Sun, 30 Dec 2012 16:00:33 +0000 (17:00 +0100)
committerKiv4h <jeffrey.reichardt@googlemail.com>
Sun, 30 Dec 2012 16:00:33 +0000 (17:00 +0100)
wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php
wcfsetup/install/files/lib/data/VersionableDatabaseObjectEditor.class.php
wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index effeaec48f5d437917bcb8d257d510dcc81ef9f0..bd49f93539d0129e0aab3fe03b901f367832018b 100644 (file)
@@ -67,7 +67,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct
        protected function createRevision() {
                $indexName = call_user_func(array($this->className, 'getDatabaseTableIndexName'));
        
-               foreach($this->objects as $object) {
+               foreach ($this->objects as $object) {
                        call_user_func(array($this->className, 'createRevision'), array_merge($object->getData(), array($indexName =>$object->__get($indexName))));
                }
        }
@@ -102,7 +102,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct
                }
 
                // currently we only support restoring one version
-               foreach($this->objects as $object) {
+               foreach ($this->objects as $object) {
                        $objectType = VersionHandler::getInstance()->getObjectTypeByName($object->objectTypeName);
                        $restoreObject = VersionHandler::getInstance()->getVersionByID($objectType->objectTypeID, $this->parameters['restoreObjectID']);
 
index edc72d37238a1a337d96a7ed981b8b676a8b0345..3cf6b9b078c18300945069b2fafab4c41b90e340 100644 (file)
@@ -55,7 +55,7 @@ abstract class VersionableDatabaseObjectEditor extends DatabaseObjectEditor {
        public static function deleteAll(array $objectIDs = array()) {
                $affectedCount = static::deleteAll($objectIDs);
                
-               //delete versions
+               // delete versions
                $sql = "DELETE FROM     ".static::getDatabaseVersionTableName()."
                                WHERE ".static::getDatabaseTableIndexName()." = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
index eaa1a67e6e46b0f74c7b37a21c91556e98727cae..74d113c1e1a709411bdd38b7c80573f15fec6564 100644 (file)
@@ -39,16 +39,14 @@ class MySQLDatabaseEditor extends DatabaseEditor {
                while ($row = $statement->fetchArray()) {
                        $typeMatches = Regex::compile('([a-z]+)\(([0-9]+)\)', Regex::CASE_INSENSITIVE)->match($row['Type']);
 
-               $columns[] = array('name' => $row['Field'], 
-                                                               'data' => array(
-                                                                                       'type' => $typeMatches[1], 
-                                                                                       'length' => $typeMatches[2],
-                                                                                       'notNull' => (($row['Null'] == 'YES') ? true : false), 
-                                                                                       'key' => (($row['Key'] == 'PRI') ? 'PRIMARY' : (($row['Key'] == 'UNI') ? 'UNIQUE' : '')),
-                                                                                       'default' => $row['Default'], 
-                                                                                       'autoIncrement' => ($row['Extra'] == 'auto_increment' ? true : false)
-                                                                               )
-                                                       );
+               $columns[] = array('name' => $row['Field'], 'data' => array(
+                               'type' => $typeMatches[1],
+                               'length' => $typeMatches[2],
+                               'notNull' => (($row['Null'] == 'YES') ? true : false),
+                               'key' => (($row['Key'] == 'PRI') ? 'PRIMARY' : (($row['Key'] == 'UNI') ? 'UNIQUE' : '')),
+                               'default' => $row['Default'],
+                               'autoIncrement' => ($row['Extra'] == 'auto_increment' ? true : false)
+                       ));
                }
                
                return $columns;
index 08ae8fdc5a8cead873925c43cdf1130e62d4a171..3fc688a87dff307c17071d6b16cf0db2eba07ec5 100644 (file)
@@ -49,16 +49,14 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
                $statement = $this->dbObj->prepareStatement($sql);
                $statement->execute(array($tableName));
                while ($row = $statement->fetchArray()) {
-               $columns[] = array('name' => $row['attname'], 
-                                                               'data' => array(
-                                                                                       'type' => $row['typname'],
-                                                                                       'length' => $row['attlen'],
-                                                                                       'notNull' => $row['attnotnull'],
-                                                                                       'key' => (($row['contype'] == 'p') ? 'PRIMARY' : (($row['contype'] == 'u') ? 'UNIQUE' : '')),
-                                                                                       'default' => $row['adsrc'],
-                                                                                       'autoIncrement' => ($row['contype'] == 'p')
-                                                                               )
-                                                       );
+               $columns[] = array('name' => $row['attname'], 'data' => array(
+                               'type' => $row['typname'],
+                               'length' => $row['attlen'],
+                               'notNull' => $row['attnotnull'],
+                               'key' => (($row['contype'] == 'p') ? 'PRIMARY' : (($row['contype'] == 'u') ? 'UNIQUE' : '')),
+                               'default' => $row['adsrc'],
+                               'autoIncrement' => ($row['contype'] == 'p')
+                       ));
                }
                
                return $columns;
index 79f1d68d26578a3ef960ecc8402eaa6ca62dac9d..c226a0a2dab0d2395fe44645eea03253a2dfcbcd 100644 (file)
@@ -972,7 +972,7 @@ class PackageInstallationDispatcher {
                        // get structure of version table
                        $versionTableColumns = WCF::getDB()->getEditor()->getColumns($objectType::getDatabaseVersionTableName());
                        
-                       if (empty($versionTableColumns)){
+                       if (empty($versionTableColumns)) {
                                $columns = array_merge($versionTableBaseColumns, $baseTableColumns);
 
                                WCF::getDB()->getEditor()->createTable($objectType::getDatabaseVersionTableName(), $columns);