[TASK] Adjust php-cs-fixer rules 24/61324/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 19 Jul 2019 11:17:51 +0000 (13:17 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 19 Jul 2019 11:55:02 +0000 (13:55 +0200)
The php-cs-fixer rules have been adjusted by the following settings:

- no_empty_phpdoc: Remove empty phpdoc blocks without any information
- no_null_property_initialization: Remove initial null value from
  class properties
- modernize_types_casting: Replace old-school `*val()` function calls
  with proper type casts

Resolves: #88802
Releases: master
Change-Id: Id2cfa849553d918e0461bafd09b3960bdf5ff700
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61324
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Windloff
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
38 files changed:
Build/.php_cs
typo3/sysext/core/Classes/Console/CommandApplication.php
typo3/sysext/core/Classes/Mail/MailMessage.php
typo3/sysext/core/Classes/Resource/Index/Indexer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/ContentController.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/QueueController.php
typo3/sysext/core/Tests/Unit/Cache/Backend/FileBackendTest.php
typo3/sysext/core/Tests/Unit/Database/RelationHandlerTest.php
typo3/sysext/core/Tests/Unit/Package/PackageTest.php
typo3/sysext/core/Tests/Unit/Utility/RootlineUtilityTest.php
typo3/sysext/extbase/Classes/Property/TypeConverter/DateTimeConverter.php
typo3/sysext/extbase/Tests/Fixture/ClassWithInjectProperties.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/Fixtures/Testclasses.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/DateTimeConverterTest.php
typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/DownloadQueueTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/ListUtilityTest.php
typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetContextTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php
typo3/sysext/form/Classes/Domain/Configuration/FormDefinition/Validators/ValidationDto.php
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/form/Classes/Mvc/Validation/Exception/InvalidValidationOptionsException.php
typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php
typo3/sysext/install/Classes/Service/LateBootService.php
typo3/sysext/install/Classes/Updates/DatabaseUpdatedPrerequisite.php
typo3/sysext/recordlist/Classes/Browser/AbstractElementBrowser.php
typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php

index 6014ef3..a5bf07e 100644 (file)
@@ -88,6 +88,9 @@ return PhpCsFixer\Config::create()
         'cast_spaces' => ['space' => 'none'],
         'declare_equal_normalize' => ['space' => 'single'],
         'dir_constant' => true,
-        'phpdoc_no_access' => true
+        'phpdoc_no_access' => true,
+        'no_empty_phpdoc' => true,
+        'no_null_property_initialization' => true,
+        'modernize_types_casting' => true,
     ])
     ->setFinder($finder);
index 36c43e6..356fa20 100644 (file)
@@ -29,8 +29,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class CommandApplication implements ApplicationInterface
 {
-    /**
-     */
     public function __construct()
     {
         $this->checkEnvironmentOrDie();
index 8697296..394d8b6 100644 (file)
@@ -43,8 +43,6 @@ class MailMessage extends Email
      */
     protected $sent = false;
 
-    /**
-     */
     private function initializeMailer()
     {
         $this->mailer = GeneralUtility::makeInstance(Mailer::class);
index 041a527..57ca6a1 100644 (file)
@@ -107,8 +107,6 @@ class Indexer
         return $fileObject;
     }
 
-    /**
-     */
     public function processChangesInStorages()
     {
         // get all file-identifiers from the storage
index 801e752..b5b337b 100644 (file)
@@ -32,8 +32,6 @@ class ContentController extends AbstractController
      */
     protected $defaultViewObjectName = \TYPO3\CMS\Extbase\Mvc\View\JsonView::class;
 
-    /**
-     */
     public function listAction()
     {
         $contents = $this->contentRepository->findAll();
index fa11229..59b54c1 100644 (file)
@@ -32,8 +32,6 @@ class QueueController extends AbstractController
      */
     protected $defaultViewObjectName = \TYPO3\CMS\Extbase\Mvc\View\JsonView::class;
 
-    /**
-     */
     public function indexAction()
     {
         $calls = [];
@@ -47,8 +45,6 @@ class QueueController extends AbstractController
         $this->forward('process');
     }
 
-    /**
-     */
     public function processAction()
     {
         $call = $this->getQueueService()->shift();
index bd8fcd3..f6963c0 100644 (file)
@@ -504,8 +504,6 @@ class FileBackendTest extends UnitTestCase
         $this->assertFileNotExists($pathAndFilename);
     }
 
-    /**
-     */
     public function invalidEntryIdentifiers(): array
     {
         return [
index 51a56d5..74531dd 100644 (file)
@@ -26,8 +26,6 @@ class RelationHandlerTest extends UnitTestCase
      */
     protected $subject;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index d66ce04..ecee8ed 100644 (file)
@@ -23,8 +23,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
  */
 class PackageTest extends UnitTestCase
 {
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
@@ -44,8 +42,6 @@ class PackageTest extends UnitTestCase
         new Package($packageManagerMock, 'Vendor.TestPackage', './ThisPackageSurelyDoesNotExist');
     }
 
-    /**
-     */
     public function validPackageKeys()
     {
         return [
@@ -74,8 +70,6 @@ class PackageTest extends UnitTestCase
         $this->assertEquals($packageKey, $package->getPackageKey());
     }
 
-    /**
-     */
     public function invalidPackageKeys()
     {
         return [
index 0a7d8e1..fb5aa0c 100644 (file)
@@ -59,9 +59,6 @@ class RootlineUtilityTest extends UnitTestCase
         $this->subject->expects(static::any())->method('resolvePageId')->willReturnArgument(0);
     }
 
-    /**
-     *
-     */
     protected function tearDown(): void
     {
         RootlineUtility::purgeCaches();
index 034ad15..f1feed0 100644 (file)
@@ -123,12 +123,12 @@ class DateTimeConverter extends \TYPO3\CMS\Extbase\Property\TypeConverter\Abstra
         if (is_string($source)) {
             $dateAsString = $source;
         } elseif (is_int($source)) {
-            $dateAsString = strval($source);
+            $dateAsString = (string)$source;
         } else {
             if (isset($source['date']) && is_string($source['date'])) {
                 $dateAsString = $source['date'];
             } elseif (isset($source['date']) && is_int($source['date'])) {
-                $dateAsString = strval($source['date']);
+                $dateAsString = (string)$source['date'];
             } elseif ($this->isDatePartKeysProvided($source)) {
                 if ($source['day'] < 1 || $source['month'] < 1 || $source['year'] < 1) {
                     return new \TYPO3\CMS\Extbase\Error\Error('Could not convert the given date parts into a DateTime object because one or more parts were 0.', 1333032779);
index c46a99e..9eb0ffa 100644 (file)
@@ -16,8 +16,6 @@ namespace TYPO3\CMS\Extbase\Tests\Fixture;
 
 use TYPO3\CMS\Extbase\Annotation as Extbase;
 
-/**
- */
 class ClassWithInjectProperties
 {
     /**
index 56aab79..3ffb284 100644 (file)
@@ -37,8 +37,6 @@ class ArgumentTest extends UnitTestCase
 
     protected $mockConfiguration;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index fb95997..92e012f 100644 (file)
@@ -109,8 +109,6 @@ class RequestBuilderTest extends UnitTestCase
         $this->mockEnvironmentService->expects($this->any())->method('isEnvironmentInBackendMode')->willReturn(false);
     }
 
-    /**
-     */
     protected function injectDependencies(): void
     {
         $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
index 8500bfb..2b5ea5c 100644 (file)
@@ -164,9 +164,6 @@ class t3lib_object_tests_b_child extends \t3lib_object_tests_b
 {
 }
 
-/**
-
- */
 interface t3lib_object_tests_someinterface extends \TYPO3\CMS\Core\SingletonInterface
 {
 }
@@ -225,9 +222,6 @@ class t3lib_object_tests_cyclic1
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_cyclic2
 {
     /**
@@ -238,9 +232,6 @@ class t3lib_object_tests_cyclic2
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_cyclic1WithSetterDependency
 {
     /**
@@ -251,9 +242,6 @@ class t3lib_object_tests_cyclic1WithSetterDependency
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_cyclic2WithSetterDependency
 {
     /**
@@ -316,9 +304,6 @@ class t3lib_object_tests_injectsettings
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_resolveablecyclic1 implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -335,9 +320,6 @@ class t3lib_object_tests_resolveablecyclic1 implements \TYPO3\CMS\Core\Singleton
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_resolveablecyclic2 implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -367,9 +349,6 @@ class t3lib_object_tests_resolveablecyclic2 implements \TYPO3\CMS\Core\Singleton
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_resolveablecyclic3 implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -386,9 +365,6 @@ class t3lib_object_tests_resolveablecyclic3 implements \TYPO3\CMS\Core\Singleton
     }
 }
 
-/**
-
- */
 class t3lib_object_tests_class_with_injectsettings
 {
     /**
@@ -419,23 +395,15 @@ If a Singleton requires a Singleton for Injection -> allowed, autowiring active
 If a Prototype requires a Prototype for Injection -> allowed, autowiring active
 If a Prototype requires a Singleton for Injection -> allowed, autowiring active
  */
-/**
 
- */
 class t3lib_object_singleton implements \TYPO3\CMS\Core\SingletonInterface
 {
 }
 
-/**
-
- */
 class t3lib_object_prototype
 {
 }
 
-/**
-
- */
 class t3lib_object_singletonNeedsPrototype implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -452,9 +420,6 @@ class t3lib_object_singletonNeedsPrototype implements \TYPO3\CMS\Core\SingletonI
     }
 }
 
-/**
-
- */
 class t3lib_object_singletonNeedsSingleton implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -471,9 +436,6 @@ class t3lib_object_singletonNeedsSingleton implements \TYPO3\CMS\Core\SingletonI
     }
 }
 
-/**
-
- */
 class t3lib_object_prototypeNeedsPrototype
 {
     /**
@@ -490,9 +452,6 @@ class t3lib_object_prototypeNeedsPrototype
     }
 }
 
-/**
-
- */
 class t3lib_object_prototypeNeedsSingleton
 {
     /**
@@ -509,9 +468,6 @@ class t3lib_object_prototypeNeedsSingleton
     }
 }
 
-/**
-
- */
 class t3lib_object_singletonNeedsPrototypeInConstructor implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -523,9 +479,6 @@ class t3lib_object_singletonNeedsPrototypeInConstructor implements \TYPO3\CMS\Co
     }
 }
 
-/**
-
- */
 class t3lib_object_singletonNeedsSingletonInConstructor implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
@@ -537,9 +490,6 @@ class t3lib_object_singletonNeedsSingletonInConstructor implements \TYPO3\CMS\Co
     }
 }
 
-/**
-
- */
 class t3lib_object_prototypeNeedsPrototypeInConstructor
 {
     /**
@@ -551,9 +501,6 @@ class t3lib_object_prototypeNeedsPrototypeInConstructor
     }
 }
 
-/**
-
- */
 class t3lib_object_prototypeNeedsSingletonInConstructor
 {
     /**
index 7597351..d6ece33 100644 (file)
@@ -40,9 +40,6 @@ class PersistenceManagerTest extends UnitTestCase
      */
     protected $mockObjectManager;
 
-    /**
-     *
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 66b4228..b93aa00 100644 (file)
@@ -189,7 +189,7 @@ class DateTimeConverterTest extends UnitTestCase
     {
         $date = $this->converter->convertFrom($source, 'DateTime', [], null);
         $this->assertInstanceOf('DateTime', $date);
-        $this->assertSame(strval($source), $date->format('U'));
+        $this->assertSame((string)$source, $date->format('U'));
     }
 
     /** Array to DateTime testcases  **/
@@ -203,7 +203,7 @@ class DateTimeConverterTest extends UnitTestCase
     {
         $date = $this->converter->convertFrom(['date' => $source], 'DateTime', [], null);
         $this->assertInstanceOf('DateTime', $date);
-        $this->assertSame(strval($source), $date->format('U'));
+        $this->assertSame((string)$source, $date->format('U'));
     }
 
     /**
@@ -409,7 +409,7 @@ class DateTimeConverterTest extends UnitTestCase
         if ($dateFormat === null) {
             $dateFormat = \TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::DEFAULT_DATE_FORMAT;
         }
-        $dateAsString = isset($source['date']) ? strval($source['date']) : '';
+        $dateAsString = isset($source['date']) ? (string)$source['date'] : '';
         $this->assertSame($dateAsString, $date->format($dateFormat));
     }
 
index 40f5759..8d65c37 100644 (file)
@@ -31,8 +31,6 @@ class DownloadQueueTest extends UnitTestCase
      */
     protected $extensionMock;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 25c990d..1ca58dd 100644 (file)
@@ -48,8 +48,6 @@ class InstallUtilityTest extends UnitTestCase
      */
     protected $installMock;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index d2f76a6..14352b2 100644 (file)
@@ -32,8 +32,6 @@ class ListUtilityTest extends UnitTestCase
      */
     protected $subject;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 9bc8cfd..ef29086 100644 (file)
@@ -183,9 +183,6 @@ class FrontendLoginControllerTest extends UnitTestCase
         $this->assertSame($expected, $subject->_call('getPreserveGetVars'));
     }
 
-    /**
-     *
-     */
     public function processUserFieldsRespectsDefaultConfigurationForStdWrapDataProvider()
     {
         return [
index a7baef4..4e0e7fd 100644 (file)
@@ -287,8 +287,6 @@ class FileListController extends ActionController
         $this->registerDocHeaderButtons();
     }
 
-    /**
-     */
     protected function initializeIndexAction()
     {
         // Apply predefined values for hidden checkboxes
@@ -323,8 +321,6 @@ class FileListController extends ActionController
         }
     }
 
-    /**
-     */
     protected function indexAction()
     {
         $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
@@ -468,8 +464,6 @@ class FileListController extends ActionController
         }
     }
 
-    /**
-     */
     protected function missingFolderAction()
     {
         if ($this->errorMessage) {
index b7954cf..26066a2 100644 (file)
@@ -18,8 +18,6 @@ use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
 use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
 
-/**
- */
 abstract class AbstractWidgetViewHelper extends AbstractViewHelper
 {
     /**
index 4ff16df..28bbad7 100644 (file)
@@ -20,8 +20,6 @@ namespace TYPO3\CMS\Fluid\ViewHelpers;
  */
 class RenderViewHelper extends \TYPO3Fluid\Fluid\ViewHelpers\RenderViewHelper
 {
-    /**
-     */
     public function initializeArguments()
     {
         parent::initializeArguments();
index 646748b..91315f4 100644 (file)
@@ -80,9 +80,6 @@ class AbstractWidgetViewHelperTest extends UnitTestCase
      */
     protected $renderingContext;
 
-    /**
-
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 2830186..0cac037 100644 (file)
@@ -26,9 +26,6 @@ class WidgetContextTest extends UnitTestCase
      */
     protected $widgetContext;
 
-    /**
-
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 758d687..7ef7138 100644 (file)
@@ -53,9 +53,6 @@ class WidgetRequestBuilderTest extends UnitTestCase
      */
     protected $mockWidgetContext;
 
-    /**
-     *
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 508c88b..d2bc196 100644 (file)
@@ -17,8 +17,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 use TYPO3\CMS\Fluid\ViewHelpers\BaseViewHelper;
 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
 
-/**
- */
 class BaseViewHelperTest extends ViewHelperBaseTestcase
 {
     /**
index 492511e..2ca7a75 100644 (file)
@@ -27,8 +27,6 @@ abstract class FormFieldViewHelperBaseTestcase extends ViewHelperBaseTestcase
      */
     protected $mockConfigurationManager;
 
-    /**
-     */
     protected function setUp(): void
     {
         parent::setUp();
index 92ff959..354cdeb 100644 (file)
@@ -145,14 +145,14 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
      *
      * @var SiteLanguage
      */
-    protected $currentSiteLanguage = null;
+    protected $currentSiteLanguage;
 
     /**
      * Reference to the current running finisher
      *
      * @var \TYPO3\CMS\Form\Domain\Finishers\FinisherInterface
      */
-    protected $currentFinisher = null;
+    protected $currentFinisher;
 
     /**
      * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
@@ -418,8 +418,6 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
             ->getPropertyFromAspect('frontend.user', 'isLoggedIn', false);
     }
 
-    /**
-     */
     protected function processVariants()
     {
         $conditionResolver = $this->getConditionResolver();
index 30fb75b..5e493d7 100644 (file)
@@ -126,7 +126,7 @@ class LocalizedSiteContentRenderingTest extends \TYPO3\CMS\Core\Tests\Functional
      *
      * @var int|null
      */
-    protected $expectedErrorLogEntries = null;
+    protected $expectedErrorLogEntries;
 
     /**
      * @var array
index 1e79d41..2ac83d3 100644 (file)
@@ -42,7 +42,7 @@ class LateBootService
     /**
      * @var ContainerInterface
      */
-    private $container = null;
+    private $container;
 
     /**
      * @param ContainerBuilder $containerBuilder
index 12995ef..1c77a28 100644 (file)
@@ -48,8 +48,6 @@ class DatabaseUpdatedPrerequisite implements PrerequisiteInterface, ChattyInterf
         return 'Database Up-to-Date';
     }
 
-    /**
-     */
     public function ensure(): bool
     {
         $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
index 4a1345b..519e12b 100644 (file)
@@ -107,8 +107,6 @@ abstract class AbstractElementBrowser
         }
     }
 
-    /**
-     */
     protected function initVariables()
     {
         $this->bparams = GeneralUtility::_GP('bparams');
index 6b778a3..836c105 100644 (file)
@@ -38,16 +38,12 @@ class DatabaseBrowser extends AbstractElementBrowser implements ElementBrowserIn
      */
     protected $expandPage;
 
-    /**
-     */
     protected function initialize()
     {
         parent::initialize();
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/BrowseDatabase');
     }
 
-    /**
-     */
     protected function initVariables()
     {
         parent::initVariables();
index 53ced68..b843fdd 100644 (file)
@@ -498,12 +498,12 @@ class GridDataService implements LoggerAwareInterface
                             }
                             break;
                         case 'change':
-                            if (stripos(strval($versionArray[$column]), str_replace('%', '', $filterText)) !== false) {
+                            if (stripos((string)$versionArray[$column], str_replace('%', '', $filterText)) !== false) {
                                 return true;
                             }
                             break;
                         default:
-                            if (stripos(strval($versionArray[$column]), $filterText) !== false) {
+                            if (stripos((string)$versionArray[$column], $filterText) !== false) {
                                 return true;
                             }
                     }