[TASK] Apply CGL compatibility (PSR-1 and PSR-2) 31/46131/2
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 21 Jan 2016 08:49:13 +0000 (09:49 +0100)
committerBenni Mack <benni@typo3.org>
Thu, 21 Jan 2016 08:53:34 +0000 (09:53 +0100)
Regular code cleanup about CGL standards.

Executed via php-cs-fixer fix --config-file Build/.php_cs typo3

Resolves: #72860
Releases: master
Change-Id: I5f9382a5ab9ad7ce1ab92da06c272e587ec78010
Reviewed-on: https://review.typo3.org/46131
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
27 files changed:
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/DummyController.php
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Classes/Controller/SimpleDataHandlerController.php
typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
typo3/sysext/backend/Classes/Tree/View/ContentLayoutPagePositionMap.php
typo3/sysext/beuser/Classes/Domain/Repository/BackendUserRepository.php
typo3/sysext/core/Classes/Charset/CharsetConverter.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Messaging/ErrorpageMessage.php
typo3/sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php
typo3/sysext/core/Classes/Resource/Utility/ListUtility.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/core/Resources/PHP/ClassMapGenerator.php
typo3/sysext/core/Tests/Unit/Core/Fixtures/test_extension/Tests/TestClass.php
typo3/sysext/core/Tests/Unit/Core/Fixtures/test_extension/class.ext_update.php
typo3/sysext/impexp/Classes/Domain/Repository/PresetRepository.php
typo3/sysext/impexp/Classes/Import.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php
typo3/sysext/install/Classes/Controller/BackendModuleController.php
typo3/sysext/lang/Classes/Controller/LanguageController.php
typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/Pbkdf2SaltTest.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/t3editor/Classes/T3editor.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index fd04f1e..fc9278f 100644 (file)
@@ -22,12 +22,10 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendLayoutView;
 use TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface;
 use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
 use TYPO3\CMS\Core\Imaging\IconRegistry;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\StringUtility;
 
 /**
  * Script Class for the New Content element wizard
index 2302064..4045250 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Script Class, creating the content for the dummy script - which is just blank output.
index ffc9f05..1b71671 100644 (file)
@@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Resource\DuplicationBehavior;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\HttpUtility;
 
 /**
  * Gateway for TCE (TYPO3 Core Engine) file-handling through POST forms.
index 8df8874..f712b58 100644 (file)
@@ -22,7 +22,6 @@ use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Messaging\AbstractMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
 /**
index 1537872..8017632 100644 (file)
@@ -150,5 +150,4 @@ class EditController extends AbstractWizardController
             return $this->closeWindow;
         }
     }
-
 }
index 867d189..2c0f246 100644 (file)
@@ -112,5 +112,4 @@ class ContentLayoutPagePositionMap extends PagePositionMap
         unset($params['new_unique_uid']);
         return GeneralUtility::linkThisScript($params);
     }
-
 }
index 72667da..e7d190f 100644 (file)
@@ -48,7 +48,7 @@ class BackendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\Backend
         if ($demand->getUserName() !== '') {
             $searchConstraints = array();
             foreach (array('userName', 'uid', 'realName') as $field) {
-                 $searchConstraints[] = $query->like(
+                $searchConstraints[] = $query->like(
                     $field, '%' . $GLOBALS['TYPO3_DB']->escapeStrForLike($demand->getUserName(), 'be_users') . '%'
                 );
             }
index efd6c8d..7265bbf 100644 (file)
@@ -53,7 +53,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class CharsetConverter implements SingletonInterface
 {
-
     /**
      * Possible strategies for handling multi-byte data
      * Only used for internal purpose
index 286af10..e55d1d0 100644 (file)
@@ -51,7 +51,7 @@ class HtmlParser
     public function splitIntoBlock($tag, $content, $eliminateExtraEndTags = false)
     {
         $tags = array_unique(GeneralUtility::trimExplode(',', $tag, true));
-        array_walk($tags, function(&$tag) {
+        array_walk($tags, function (&$tag) {
             $tag = preg_quote($tag, '/');
         });
         $regexStr = '/\\<\\/?(' . implode('|', $tags) . ')(\\s*\\>|\\s[^\\>]*\\>)/si';
index 06da9de..73609e8 100644 (file)
@@ -46,5 +46,4 @@ class ErrorpageMessage extends AbstractStandaloneMessage
         $defaultMarkers['###EXTPATH_BACKEND###'] = ExtensionManagementUtility::siteRelPath('backend');
         return $defaultMarkers;
     }
-
 }
index a8873d8..920f40a 100644 (file)
@@ -15,8 +15,8 @@ namespace TYPO3\CMS\Core\Resource\Driver;
  */
 
 use TYPO3\CMS\Core\Charset\CharsetConverter;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
index f328cd1..a99a7d2 100644 (file)
@@ -39,7 +39,6 @@ class ListUtility
             $name = $folder->getName();
             $role = $folder->getRole();
             if ($role !== FolderInterface::ROLE_DEFAULT) {
-
                 $tempName = $lang->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:role_folder_' . $role, true);
                 if (!empty($tempName) && ($tempName !== $name)) {
                     // Set new name and append original name
index e8d1e95..52477f0 100644 (file)
@@ -36,7 +36,6 @@ use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
 use TYPO3\CMS\Core\Type\Exception\InvalidEnumerationValueException;
-use TYPO3\CMS\Core\Utility\CommandUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Lang\LanguageService;
 
index b487ed6..233f348 100644 (file)
@@ -18,8 +18,8 @@
 
 namespace Composer\Autoload;
 
-use Symfony\Component\Finder\Finder;
 use Composer\IO\IOInterface;
+use Symfony\Component\Finder\Finder;
 
 /**
  * ClassMapGenerator
@@ -66,7 +66,7 @@ class ClassMapGenerator
                 $path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path);
             } else {
                 throw new \RuntimeException(
-                    'Could not scan for classes inside "'.$path.
+                    'Could not scan for classes inside "' . $path .
                     '" which does not appear to be a file nor a folder'
                 );
             }
@@ -95,10 +95,10 @@ class ClassMapGenerator
 
                 if (!isset($map[$class])) {
                     $map[$class] = $filePath;
-                } elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
+                } elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($map[$class] . ' ' . $filePath, '\\', '/'))) {
                     $io->writeError(
-                        '<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
-                        ' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
+                        '<warning>Warning: Ambiguous class resolution, "' . $class . '"' .
+                        ' was found in both "' . $map[$class] . '" and "' . $filePath . '", the first will be used.</warning>'
                     );
                 }
             }
@@ -132,11 +132,11 @@ class ClassMapGenerator
                 }
             }
         } catch (\Exception $e) {
-            throw new \RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e);
+            throw new \RuntimeException('Could not scan for classes inside ' . $path . ": \n" . $e->getMessage(), 0, $e);
         }
 
         // return early if there is no chance of matching anything in this file
-        if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) {
+        if (!preg_match('{\b(?:class|interface' . $extraTypes . ')\s}i', $contents)) {
             return array();
         }
 
@@ -161,7 +161,7 @@ class ClassMapGenerator
 
         preg_match_all('{
             (?:
-                 \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+)
+                 \b(?<![\$:>])(?P<type>class|interface' . $extraTypes . ') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+)
                | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;]
             )
         }ix', $contents, $matches);
@@ -176,7 +176,7 @@ class ClassMapGenerator
                 $name = $matches['name'][$i];
                 if ($name[0] === ':') {
                     // This is an XHP class, https://github.com/facebook/xhp
-                    $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
+                    $name = 'xhp' . substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
                 } elseif ($matches['type'][$i] === 'enum') {
                     // In Hack, something like:
                     //   enum Foo: int { HERP = '123'; }
index 3939335..9229e65 100644 (file)
@@ -25,7 +25,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class PresetRepository
 {
-
     /**
      * @param int $pageId
      * @return array
index 30fa5b9..702140f 100644 (file)
@@ -311,7 +311,8 @@ class Import extends ImportExport
      * @param array $storageRecord The storage record which should get compared
      * @return bool Returns TRUE when both object storages can be seen as equivalent
      */
-    protected function isEquivalentObjectStorage(ResourceStorage $storageObject, array $storageRecord) {
+    protected function isEquivalentObjectStorage(ResourceStorage $storageObject, array $storageRecord)
+    {
         // compare the properties: driver, writable and online
         if (
             $storageObject->getDriverType() === $storageRecord['driver']
@@ -336,7 +337,8 @@ class Import extends ImportExport
      *
      * @return array Messages explaining issues which need to get resolved before import
      */
-    public function checkImportPrerequisites() {
+    public function checkImportPrerequisites()
+    {
         $messages = array();
 
         // Check #1: Extension dependencies
@@ -354,7 +356,7 @@ class Import extends ImportExport
 
         // Check #2: If the path for every local storage object exists.
         // Else files can't get moved into a newly imported storage.
-        if(is_array($this->dat['header']['records']['sys_file_storage'])) {
+        if (is_array($this->dat['header']['records']['sys_file_storage'])) {
             foreach ($this->dat['header']['records']['sys_file_storage'] as $sysFileStorageUid => $_) {
                 $storageRecord = $this->dat['records']['sys_file_storage:' . $sysFileStorageUid]['data'];
                 // continue with Local, writable and online storage only
@@ -385,7 +387,6 @@ class Import extends ImportExport
                             $configuration = $resourceStorage->getConfiguration();
                             $messages['resourceStorageFolderMissing_' . $storageRecordUid] = 'The resource storage "' . $resourceStorage->getName() . '" will get imported. The storage target directory "' . $configuration['basePath'] . '" does not exist. Please create the directory prior to starting the import!';
                         }
-
                     }
                 }
             }
index de3ccc6..7bf4a1a 100644 (file)
@@ -731,4 +731,4 @@ class CrawlerHook
             }
         }
     }
-}
\ No newline at end of file
+}
index 0df3183..ae42487 100644 (file)
@@ -100,7 +100,6 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
             $theOutput = '<h1>' . htmlspecialchars($this->getLanguageService()->getLL('tsconf_title')) . '</h1>';
 
             if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
-
                 $TSparts = BackendUtility::getPagesTSconfig($this->pObj->id, null, true);
                 $lines = array();
                 $pUids = array();
index ad070d9..b905602 100644 (file)
@@ -36,7 +36,6 @@ use TYPO3\CMS\Install\Service\EnableFileService;
  */
 class BackendModuleController
 {
-
     /**
      * Index action shows install tool / step installer or redirect to action to enable install tool
      *
@@ -83,5 +82,4 @@ class BackendModuleController
         }
         return $response;
     }
-
 }
index 1463e68..9a2bb7a 100644 (file)
@@ -20,14 +20,14 @@ use TYPO3\CMS\Backend\Template\Components\Menu\MenuItem;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Lang\Domain\Model\Extension;
 use TYPO3\CMS\Lang\Domain\Repository\ExtensionRepository;
 use TYPO3\CMS\Lang\Domain\Repository\LanguageRepository;
 use TYPO3\CMS\Lang\Service\RegistryService;
 use TYPO3\CMS\Lang\Service\TranslationService;
-use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
-use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
-use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 
 /**
  * Language controller
index ca3c81e..28ae799 100644 (file)
@@ -27,7 +27,6 @@ use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\ClientUtility;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Lang\LanguageService;
 use TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi;
 
index 6952b48..0d24e7b 100644 (file)
@@ -338,7 +338,7 @@ class Pbkdf2SaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         $this->objectInstance->setMinHashCount(1000);
         $passlibSaltedHash= '$pbkdf2-sha256$6400$.6UI/S.nXIk8jcbdHx3Fhg$98jZicV16ODfEsEZeYPGHU3kbrUrvUEXOPimVSQDD44';
-        $saltedHashPassword = $this->objectInstance->getHashedPassword("password", $passlibSaltedHash);
+        $saltedHashPassword = $this->objectInstance->getHashedPassword('password', $passlibSaltedHash);
 
         $this->assertSame($passlibSaltedHash, $saltedHashPassword);
     }
index 59bd260..6c1278a 100644 (file)
@@ -639,7 +639,7 @@ class SetupModuleController extends AbstractModule
                             '<a id="clear_button_' . htmlspecialchars($fieldName) . '" '
                                 . 'onclick="clearExistingImage(); return false;" class="btn btn-default">'
                                 . $iconFactory->getIcon('actions-delete', Icon::SIZE_SMALL)
-                            .'</a>';
+                            . '</a>';
                     }
                     $html .=
                         '<a id="add_button_' . htmlspecialchars($fieldName) . '" class="btn btn-default btn-add-avatar"'
index 8e65253..0008610 100755 (executable)
@@ -170,7 +170,6 @@ class T3editor implements \TYPO3\CMS\Core\SingletonInterface
 
         $this->relExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3editor');
         $this->codemirrorPath = $this->relExtPath . $this->codemirrorPath;
-
     }
 
     /**
index 4d5d666..f89083c 100755 (executable)
@@ -18,7 +18,6 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\BaseScriptClass;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
-use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;