[TASK] Apply CGL compatibility (PSR-1 and PSR-2) 24/45524/2
authorBenni Mack <benni@typo3.org>
Wed, 30 Dec 2015 19:16:52 +0000 (20:16 +0100)
committerBenni Mack <benni@typo3.org>
Wed, 30 Dec 2015 20:20:04 +0000 (21:20 +0100)
Regular code cleanup about CGL standards.

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

Resolves: #72490
Releases: master
Change-Id: I8bfa99339bd337a36a6d475553efa18033047368
Reviewed-on: https://review.typo3.org/45524
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
33 files changed:
typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php
typo3/sysext/backend/Classes/Http/Application.php
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Classes/Charset/CharsetConverter.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Classes/Mail/Rfc822AddressesParser.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Resources/PHP/RemoveXSS.php
typo3/sysext/core/Tests/FunctionalTestCaseBootstrapUtility.php
typo3/sysext/core/Tests/Unit/Http/MessageTest.php
typo3/sysext/core/Tests/Unit/Utility/StringUtilityTest.php
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/Link/ActionViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/SpacelessViewHelperTest.php
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Link/ClickEnlargeViewHelper.php
typo3/sysext/form/Classes/Domain/Builder/ValidationBuilder.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Fixtures/PageRepositoryFixture.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/recordlist/Classes/RecordList.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php

index 3f6403a..9a1cf80 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
  */
 
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
index a48eb39..ebbe17a 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Http;
  */
 use TYPO3\CMS\Core\Core\ApplicationInterface;
 use TYPO3\CMS\Core\Core\Bootstrap;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Entry point for the TYPO3 Backend (HTTP requests)
@@ -105,5 +104,4 @@ class Application implements ApplicationInterface
     {
         define('TYPO3_MODE', 'BE');
     }
-
 }
index 3d12824..7e9cfb6 100644 (file)
@@ -18,7 +18,6 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Lang\LanguageService;
 
 /**
index bc04af3..dd9971a 100644 (file)
@@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\View\StandaloneView;
 
 /**
  * TYPO3 Backend Template Class
index abb13ea..3621a9d 100644 (file)
@@ -1018,4 +1018,4 @@ abstract class AbstractTreeView
     {
         return $GLOBALS['TYPO3_DB'];
     }
-}
\ No newline at end of file
+}
index 712e7ed..d98873b 100755 (executable)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
@@ -22,7 +21,6 @@ use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Database\PreparedStatement;
 use TYPO3\CMS\Core\Database\RelationHandler;
-use TYPO3\CMS\Core\FormProtection\FormProtectionFactory;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
index 01d8056..318ad5a 100644 (file)
@@ -53,7 +53,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class CharsetConverter implements SingletonInterface
 {
-
     /**
      * ASCII Value for chars with no equivalent.
      *
@@ -1729,7 +1728,8 @@ class CharsetConverter implements SingletonInterface
      *
      * @return array
      */
-    protected function getAllLanguageCodes() {
+    protected function getAllLanguageCodes()
+    {
         // Get all languages where TYPO3 code is the same as the ISO code
         $typo3LanguageCodes = array_keys($this->charSetArray);
         $allLanguageCodes = array_combine($typo3LanguageCodes, $typo3LanguageCodes);
index 9313ce9..9bde3a3 100644 (file)
@@ -741,7 +741,8 @@ class Bootstrap
      * @throws \RuntimeException if the method was already called during a request
      * @return Bootstrap
      */
-    public function setRequestType($requestType) {
+    public function setRequestType($requestType)
+    {
         if (defined('TYPO3_REQUESTTYPE')) {
             throw new \RuntimeException('TYPO3_REQUESTTYPE has already been set, cannot be called multiple times', 1450561878);
         }
index cd74bb0..a3f7b31 100644 (file)
@@ -423,4 +423,4 @@ class SystemEnvironmentBuilder
 
         return false;
     }
-}
\ No newline at end of file
+}
index bd10a23..c97d625 100644 (file)
@@ -5077,8 +5077,8 @@ class DataHandler
     {
         $uid = (int)$uid;
         if ($uid === 0) {
-               $this->newlog2('Deleting all pages starting from the root-page is disabled.', 'pages', 0, 0, 2);
-               return;
+            $this->newlog2('Deleting all pages starting from the root-page is disabled.', 'pages', 0, 0, 2);
+            return;
         }
         // Getting list of pages to delete:
         if ($force) {
index 107c5e9..72e9e08 100644 (file)
@@ -933,7 +933,7 @@ class RelationHandler
                 if (!empty($updateValues)) {
                     // Update tstamp if any foreign field value has changed
                     if (!empty($GLOBALS['TCA'][$table]['ctrl']['tstamp'])) {
-                        $currentRow = BackendUtility::getRecord($table, $uid, implode(',', array_keys($updateValues)) , '', true);
+                        $currentRow = BackendUtility::getRecord($table, $uid, implode(',', array_keys($updateValues)), '', true);
                         $needTstampUpdate = false;
                         if (empty($currentRow)) {
                             $needTstampUpdate = true;
index 615c876..3fdf783 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Core\Html;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
index 19ee84f..2dbe84e 100644 (file)
@@ -2428,7 +2428,6 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface
             )
         ),
 
-
         // Sysnote
         'sysnote-type-0' => array(
             'provider' => FontawesomeIconProvider::class,
index 5ae3a4c..157c690 100644 (file)
@@ -37,7 +37,6 @@ namespace TYPO3\CMS\Core\Mail;
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * @category Mail
- * @package Mail
  * @copyright 2001-2010 Richard Heyes
  * @license http://opensource.org/licenses/bsd-license.php New BSD License
  * @link http://pear.php.net/package/Mail/
@@ -60,7 +59,6 @@ namespace TYPO3\CMS\Core\Mail;
  * print_r($structure);
  * @version $Revision: 294749 $
  * @license BSD
- * @package Mail
  */
 class Rfc822AddressesParser
 {
index 0c8edcc..48d8a8a 100755 (executable)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Core\Utility;
 
 use TYPO3\CMS\Core\Core\ApplicationContext;
 use TYPO3\CMS\Core\Core\ClassLoadingInformation;
-use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
 use TYPO3\CMS\Core\Service\OpcodeCacheService;
 use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Frontend\Page\PageRepository;
index 44bfc97..7bf25c8 100644 (file)
@@ -15,7 +15,6 @@
  * License:
  * This code is public domain, you are free to do whatever you want with it,
  * including adding it to your own project which can be under any license.
- * @package    RemoveXSS
  */
 class RemoveXSS
 {
index 0e0a6d4..d1bcd31 100644 (file)
@@ -70,7 +70,7 @@ class FunctionalTestCaseBootstrapUtility
      * @param string $testCaseClassName Name of test case class
      * @return string
      */
-    static public function getInstanceIdentifier($testCaseClassName)
+    public static function getInstanceIdentifier($testCaseClassName)
     {
         // 7 characters of sha1 should be enough for a unique identification
         return substr(sha1($testCaseClassName), 0, 7);
@@ -82,7 +82,7 @@ class FunctionalTestCaseBootstrapUtility
      * @param string $testCaseClassName Name of test case class
      * @return string
      */
-    static public function getInstancePath($testCaseClassName)
+    public static function getInstancePath($testCaseClassName)
     {
         return ORIGINAL_ROOT . 'typo3temp/functional-' . static::getInstanceIdentifier($testCaseClassName);
     }
index a056248..3ac8b89 100644 (file)
@@ -309,5 +309,4 @@ class MessageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->setExpectedException('InvalidArgumentException');
         $this->message->withAddedHeader($name, $value);
     }
-
 }
index fc0b16f..188ed9d 100644 (file)
@@ -21,7 +21,6 @@ use TYPO3\CMS\Core\Utility\StringUtility;
  */
 class StringUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 {
-
     /**
      * Data provider for endsWithReturnsTrueForMatchingFirstPart
      *
index 09b62b9..e5676cb 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Extbase\DomainObject;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
 /**
  * A generic Domain Object.
  *
index 9c4cf82..97dd4e6 100644 (file)
@@ -39,5 +39,4 @@ class ActionViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBased
         $this->registerTagAttribute('rev', 'string', 'Specifies the relationship between the linked document and the current document');
         $this->registerTagAttribute('target', 'string', 'Specifies where to open the linked document');
     }
-
 }
index 59ee773..e8ed59d 100644 (file)
@@ -20,7 +20,6 @@ use TYPO3\CMS\Fluid\ViewHelpers\SpacelessViewHelper;
  */
 class SpacelessViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase
 {
-
     /**
      * @test
      */
index 1284210..1a5d67c 100644 (file)
@@ -14,12 +14,12 @@ namespace TYPO3\CMS\FluidStyledContent\ViewHelpers\Link;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Resource\FileInterface;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
-use TYPO3\CMS\Core\Resource\FileInterface;
 
 /**
  * A view helper for creating a link for an image popup.
index b2a638d..1074759 100644 (file)
@@ -151,7 +151,7 @@ class ValidationBuilder
                         if ((int)$ruleArguments['showMessage'] === 1) {
                             $mandatoryMessage = $validator->renderMessage($ruleArguments['message.'], $ruleArguments['message']);
                         } else {
-                            $mandatoryMessage = NULL;
+                            $mandatoryMessage = null;
                         }
 
                         $this->rules[$this->configuration->getPrefix()][$fieldName][] = array(
index 8f56545..81e5a91 100644 (file)
@@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
 use TYPO3\CMS\Core\Localization\Locales;
 use TYPO3\CMS\Core\Localization\LocalizationFactory;
 use TYPO3\CMS\Core\Locking\Exception\LockAcquireWouldBlockException;
-use TYPO3\CMS\Core\Locking\Locker;
 use TYPO3\CMS\Core\Locking\LockFactory;
 use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
 use TYPO3\CMS\Core\Messaging\ErrorpageMessage;
index a0bbe92..d64c8d0 100755 (executable)
@@ -4696,7 +4696,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     /**
      * @return array
      */
-    public function substituteMarkerArrayCachedReturnsExpectedContentDataProvider() {
+    public function substituteMarkerArrayCachedReturnsExpectedContentDataProvider()
+    {
         return array(
             'no markers defined' => array(
                 'dummy content with ###UNREPLACED### marker',
@@ -4807,7 +4808,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      * @param bool $shouldQueryCache
      * @param bool $shouldStoreCache
      */
-    public function substituteMarkerArrayCachedReturnsExpectedContent($content, array $markContentArray, array $subpartContentArray, array $wrappedSubpartContentArray, $expectedContent, $shouldQueryCache = true, $shouldStoreCache = true) {
+    public function substituteMarkerArrayCachedReturnsExpectedContent($content, array $markContentArray, array $subpartContentArray, array $wrappedSubpartContentArray, $expectedContent, $shouldQueryCache = true, $shouldStoreCache = true)
+    {
         /** @var PageRepositoryFixture|\PHPUnit_Framework_MockObject_MockObject $pageRepo */
         $pageRepo = $this->typoScriptFrontendControllerMock->sys_page;
         $pageRepo->resetCallCount();
@@ -4822,7 +4824,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     /**
      * @test
      */
-    public function substituteMarkerArrayCachedRetrievesCachedValueFromRuntimeCache() {
+    public function substituteMarkerArrayCachedRetrievesCachedValueFromRuntimeCache()
+    {
         /** @var PageRepositoryFixture|\PHPUnit_Framework_MockObject_MockObject $pageRepo */
         $pageRepo = $this->typoScriptFrontendControllerMock->sys_page;
         $pageRepo->resetCallCount();
@@ -4850,7 +4853,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     /**
      * @test
      */
-    public function substituteMarkerArrayCachedRetrievesCachedValueFromDbCache() {
+    public function substituteMarkerArrayCachedRetrievesCachedValueFromDbCache()
+    {
         /** @var PageRepositoryFixture|\PHPUnit_Framework_MockObject_MockObject $pageRepo */
         $pageRepo = $this->typoScriptFrontendControllerMock->sys_page;
         $pageRepo->resetCallCount();
@@ -4878,7 +4882,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     /**
      * @test
      */
-    public function substituteMarkerArrayCachedStoresResultInCaches() {
+    public function substituteMarkerArrayCachedStoresResultInCaches()
+    {
         /** @var PageRepositoryFixture|\PHPUnit_Framework_MockObject_MockObject $pageRepo */
         $pageRepo = $this->typoScriptFrontendControllerMock->sys_page;
         $pageRepo->resetCallCount();
@@ -4909,7 +4914,8 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     /**
      * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
      */
-    protected function getFrontendController() {
+    protected function getFrontendController()
+    {
         return $GLOBALS['TSFE'];
     }
 }
index d51370e..8f52b3f 100644 (file)
@@ -21,7 +21,6 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
  */
 class PageRepositoryFixture extends PageRepository
 {
-
     public static $getHashCallCount = 0;
     public static $storeHashCallCount = 0;
     public static $dbCacheContent = null;
index d337c2f..2592c29 100644 (file)
@@ -4342,7 +4342,6 @@ class ImportExport
         return !empty($this->errorLog) ? DebugUtility::viewArray($this->errorLog) : '';
     }
 
-
     /**
      * @return BackendUserAuthentication
      */
index 837a2b3..6b0d737 100755 (executable)
@@ -31,7 +31,6 @@ use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Lang\LanguageService;
 
index 738ddf4..e36c111 100644 (file)
@@ -24,7 +24,6 @@ use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
 use TYPO3\CMS\Frontend\Page\PageRepository;
index 6e21cae..99e68cd 100644 (file)
@@ -93,7 +93,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
 
         $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
             ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
-            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(TRUE));
+            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(true));
     }
 
     /**
index d53908f..47391b2 100644 (file)
@@ -97,7 +97,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
 
         $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
             ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
-            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(TRUE));
+            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(true));
     }
 
     /**
index 4add960..de47224 100644 (file)
@@ -97,7 +97,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL
 
         $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
             ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentImage)
-            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(TRUE));
+            ->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD')->setStrict(true));
     }
 
     /**