Fixes code to match PHP CodeSniffer rules
authorMatthias Schmidt <gravatronics@live.com>
Sat, 5 Jan 2013 12:18:10 +0000 (13:18 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 5 Jan 2013 12:18:10 +0000 (13:18 +0100)
wcfsetup/install/files/lib/system/SingletonFactory.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 9765eccaaf75cc1fd91500dd00b306b01fb5c278..6824d1aa2c9d5231eca9cf94a696d2ac48b7ce18 100644 (file)
@@ -55,7 +55,7 @@ abstract class SingletonFactory {
                        self::$__singletonObjects[$className] = null;
                        self::$__singletonObjects[$className] = new $className();
                }
-               else if (array_key_exists($className, self::$__singletonObjects) && is_null(self::$__singletonObjects[$className])) {
+               else if (array_key_exists($className, self::$__singletonObjects) && self::$__singletonObjects[$className] === null) {
                        throw new SystemException("Infinite loop detected while trying to retrieve object for '".$className."'");
                }
                
index 45c61b9e11fe63f0791c09aa5c0e8d37798c46e4..370742808a45e4a527ce589d859c895f82c9e225 100644 (file)
@@ -15,8 +15,10 @@ use wcf\system\cache\CacheHandler;
 use wcf\system\database\statement\PreparedStatement;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
-use wcf\system\form\container;
-use wcf\system\form\element;
+use wcf\system\form\container\GroupFormElementContainer;
+use wcf\system\form\container\MultipleSelectionFormElementContainer;
+use wcf\system\form\element\MultipleSelectionFormElement;
+use wcf\system\form\element\TextInputFormElement;
 use wcf\system\form\FormDocument;
 use wcf\system\form;
 use wcf\system\language\LanguageFactory;
@@ -26,6 +28,7 @@ use wcf\system\package\plugin\SQLPackageInstallationPlugin;
 use wcf\system\request\LinkHandler;
 use wcf\system\request\RouteHandler;
 use wcf\system\style\StyleHandler;
+use wcf\system\version\VersionHandler;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 use wcf\util\HeaderUtil;
@@ -561,8 +564,8 @@ class PackageInstallationDispatcher {
        protected function promptPackageDir() {
                if (!PackageInstallationFormManager::findForm($this->queue, 'packageDir')) {
                        
-                       $container = new container\GroupFormElementContainer();
-                       $packageDir = new element\TextInputFormElement($container);
+                       $container = new GroupFormElementContainer();
+                       $packageDir = new TextInputFormElement($container);
                        $packageDir->setName('packageDir');
                        $packageDir->setLabel(WCF::getLanguage()->get('wcf.acp.package.packageDir.input'));
                        
@@ -629,11 +632,11 @@ class PackageInstallationDispatcher {
         */
        protected function promptOptionalPackages(array $packages) {
                if (!PackageInstallationFormManager::findForm($this->queue, 'optionalPackages')) {
-                       $container = new container\MultipleSelectionFormElementContainer();
+                       $container = new MultipleSelectionFormElementContainer();
                        $container->setName('optionalPackages');
                        
                        foreach ($packages as $package) {
-                               $optionalPackage = new element\MultipleSelectionFormElement($container);
+                               $optionalPackage = new MultipleSelectionFormElement($container);
                                $optionalPackage->setName('optionalPackages');
                                $optionalPackage->setLabel($package['packageName']);
                                $optionalPackage->setValue($package['package']);
@@ -954,12 +957,12 @@ class PackageInstallationDispatcher {
                        break;
                }
        }
-
+       
        /*
         * Restructure version tables.
         */
        protected function restructureVersionTables() {
-               $objectTypes = \wcf\system\version\VersionHandler::getInstance()->getObjectTypes();
+               $objectTypes = VersionHandler::getInstance()->getObjectTypes();
                
                if (empty($objectTypes)) {
                        return;
@@ -971,8 +974,8 @@ class PackageInstallationDispatcher {
                $versionTableBaseColumns[] = array('name' => 'versionUserID', 'data' => array('type' => 'INT'));
                $versionTableBaseColumns[] = array('name' => 'versionUsername', 'data' => array('type' => 'VARCHAR', 'length' => 255));
                $versionTableBaseColumns[] = array('name' => 'versionTime', 'data' => array('type' => 'INT'));
-       
-               foreach ($objectTypes as $objectTypeID => $objectType) {                                                
+               
+               foreach ($objectTypes as $objectTypeID => $objectType) {
                        // get structure of base table
                        $baseTableColumns = WCF::getDB()->getEditor()->getColumns($objectType::getDatabaseTableName());
                        // get structure of version table
@@ -980,7 +983,7 @@ class PackageInstallationDispatcher {
                        
                        if (empty($versionTableColumns)) {
                                $columns = array_merge($versionTableBaseColumns, $baseTableColumns);
-
+                               
                                WCF::getDB()->getEditor()->createTable($objectType::getDatabaseVersionTableName(), $columns);
                        }
                        else {
@@ -1001,5 +1004,5 @@ class PackageInstallationDispatcher {
                                }
                        }
                }
-       }       
+       }
 }