From: Kiv4h Date: Sun, 30 Dec 2012 16:00:33 +0000 (+0100) Subject: Final code formatting, Travis should pass X-Git-Tag: 2.0.0_Beta_1~638^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5fe135db15a69ada6a905ac7c54a1c0c5fab073b;p=GitHub%2FWoltLab%2FWCF.git Final code formatting, Travis should pass --- diff --git a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php index effeaec48f..bd49f93539 100644 --- a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php @@ -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']); diff --git a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectEditor.class.php b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectEditor.class.php index edc72d3723..3cf6b9b078 100644 --- a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectEditor.class.php +++ b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectEditor.class.php @@ -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); diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index eaa1a67e6e..74d113c1e1 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php index 08ae8fdc5a..3fc688a87d 100644 --- a/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 79f1d68d26..c226a0a2da 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -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);