diff --git a/Build/.php_cs b/Build/.php_cs index b6c42dd3e66f5815bb80df634d75b584fdcf9c9f..7639cff1425d8329ecbb1f2b91956407f81c2f6a 100644 --- a/Build/.php_cs +++ b/Build/.php_cs @@ -57,15 +57,19 @@ return PhpCsFixer\Config::create() '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], 'blank_line_after_opening_tag' => true, + 'braces' => ['allow_single_line_closure' => true], 'cast_spaces' => ['space' => 'none'], + 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], 'declare_equal_normalize' => ['space' => 'none'], 'dir_constant' => true, 'function_typehint_space' => true, 'hash_to_slash_comment' => true, 'lowercase_cast' => true, + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'modernize_types_casting' => true, 'native_function_casing' => true, + 'new_with_braces' => true, 'no_alias_functions' => true, 'no_blank_lines_after_phpdoc' => true, 'no_empty_phpdoc' => true, diff --git a/Build/Scripts/annotationChecker.php b/Build/Scripts/annotationChecker.php index cf33794bcd50b141008adff5cee0dcdfa0fd862e..0d43c3073dce8c91995b400c012466a2c430a61e 100755 --- a/Build/Scripts/annotationChecker.php +++ b/Build/Scripts/annotationChecker.php @@ -95,7 +95,7 @@ class NodeVisitor extends NodeVisitorAbstract } } -$parser = (new ParserFactory)->create(ParserFactory::ONLY_PHP7); +$parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7); $finder = new Symfony\Component\Finder\Finder(); $finder->files() diff --git a/Build/Scripts/docBlockChecker.php b/Build/Scripts/docBlockChecker.php index a289cfc6ffb7202e490f0a09095f5b06d59f15cf..6161abf059c51fbd58b017cfb185c223c8c3d7a0 100755 --- a/Build/Scripts/docBlockChecker.php +++ b/Build/Scripts/docBlockChecker.php @@ -202,7 +202,7 @@ class NodeVisitor implements \PhpParser\NodeVisitor } } -$parser = (new ParserFactory)->create(ParserFactory::ONLY_PHP7); +$parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7); $finder = new Symfony\Component\Finder\Finder(); $finder->files() diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php index 91580e6c478a9630e38138254cf8df43592f273f..dd88dec4e864e06fbd9fcaf58e845cf7944c379a 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php @@ -43,7 +43,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ], ], ]; - self::assertSame($input, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($input, (new DatabaseRowInitializeNew())->addData($input)); } /** @@ -58,7 +58,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444431128); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -79,7 +79,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $expected = $input; $expected['databaseRow']['pid'] = 23; - self::assertSame($expected, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($expected, (new DatabaseRowInitializeNew())->addData($input)); } /** @@ -112,7 +112,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'userTsValue', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -143,7 +143,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase $expected = [ 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -177,7 +177,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'pageTsValue', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -208,7 +208,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase $expected = [ 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -249,7 +249,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'pageTsValue', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -281,7 +281,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'valueFromNeighbor', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -327,7 +327,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'valueFromNeighbor', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -359,7 +359,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'getValue', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -395,7 +395,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase $expected = [ 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -446,7 +446,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'aField' => 'postValue', 'pid' => 23, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -465,7 +465,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444434102); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -483,7 +483,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444434103); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -515,7 +515,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase $expected = $input; $expected['databaseRow']['theForeignSelectorField'] = 42; $expected['databaseRow']['pid'] = 5; - self::assertSame($expected, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($expected, (new DatabaseRowInitializeNew())->addData($input)); } /** @@ -545,7 +545,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444434104); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -575,7 +575,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1490360772); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -609,7 +609,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase 'sys_language_uid' => 42, 'pid' => 1, ]; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result); } @@ -629,7 +629,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $expected = []; $expected['pid'] = 23; - $result = (new DatabaseRowInitializeNew)->addData($input); + $result = (new DatabaseRowInitializeNew())->addData($input); self::assertSame($expected, $result['databaseRow']); } @@ -656,7 +656,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $expected = $input; $expected['databaseRow']['pid'] = 23; - self::assertSame($expected, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($expected, (new DatabaseRowInitializeNew())->addData($input)); } /** @@ -682,7 +682,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1461598332); - (new DatabaseRowInitializeNew)->addData($input); + (new DatabaseRowInitializeNew())->addData($input); } /** @@ -708,7 +708,7 @@ class DatabaseRowInitializeNewTest extends UnitTestCase ]; $expected = $input; $expected['databaseRow']['pid'] = 42; - self::assertSame($expected, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($expected, (new DatabaseRowInitializeNew())->addData($input)); } /** @@ -732,6 +732,6 @@ class DatabaseRowInitializeNewTest extends UnitTestCase $expected = $input; $expected['databaseRow']['theParentField'] = 42; $expected['databaseRow']['pid'] = 23; - self::assertSame($expected, (new DatabaseRowInitializeNew)->addData($input)); + self::assertSame($expected, (new DatabaseRowInitializeNew())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUserPermissionCheckTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUserPermissionCheckTest.php index 4773d9fbdf19a7d5ef8e92023af76f7a21a66490..4c37985ca5da5b0cd9a02ad4624646766d815c80 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUserPermissionCheckTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUserPermissionCheckTest.php @@ -54,7 +54,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase { $this->beUserProphecy->isAdmin()->willReturn(true); - $result = (new DatabaseUserPermissionCheck)->addData([]); + $result = (new DatabaseUserPermissionCheck())->addData([]); self::assertSame(Permission::ALL, $result['userPermissionOnPage']); } @@ -73,7 +73,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedTableModifyException::class); $this->expectExceptionCode(1437683248); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -97,7 +97,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedContentEditException::class); $this->expectExceptionCode(1437679657); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -119,7 +119,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->calcPerms(['pid' => 321])->willReturn(Permission::CONTENT_EDIT); $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::any())->willReturn(true); - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::CONTENT_EDIT, $result['userPermissionOnPage']); } @@ -145,7 +145,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedPageEditException::class); $this->expectExceptionCode(1437679336); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -177,7 +177,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedPageEditException::class); $this->expectExceptionCode(1437679336); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -206,7 +206,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->calcPerms($input['databaseRow'])->willReturn(Permission::PAGE_EDIT); $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::cetera())->willReturn(true); - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::PAGE_EDIT, $result['userPermissionOnPage']); } @@ -230,7 +230,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::cetera())->willReturn(true); $GLOBALS['TCA'][$input['tableName']]['ctrl']['security']['ignoreRootLevelRestriction'] = true; - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::ALL, $result['userPermissionOnPage']); } @@ -256,7 +256,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedRootNodeException::class); $this->expectExceptionCode(1437679856); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -282,7 +282,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedEditInternalsException::class); $this->expectExceptionCode(1437687404); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -306,7 +306,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedContentEditException::class); $this->expectExceptionCode(1437745759); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -333,7 +333,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedPageNewException::class); $this->expectExceptionCode(1437745640); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -367,7 +367,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedHookException::class); $this->expectExceptionCode(1437689705); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } /** @@ -398,7 +398,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase } ]; - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::CONTENT_EDIT, $result['userPermissionOnPage']); } @@ -422,7 +422,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->calcPerms($input['parentPageRow'])->willReturn(Permission::PAGE_NEW); $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::cetera())->willReturn(true); - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::PAGE_NEW, $result['userPermissionOnPage']); } @@ -446,7 +446,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->calcPerms($input['parentPageRow'])->willReturn(Permission::CONTENT_EDIT); $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::cetera())->willReturn(true); - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::CONTENT_EDIT, $result['userPermissionOnPage']); } @@ -467,7 +467,7 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->beUserProphecy->recordEditAccessInternals($input['tableName'], Argument::cetera())->willReturn(true); $GLOBALS['TCA'][$input['tableName']]['ctrl']['security']['ignoreRootLevelRestriction'] = true; - $result = (new DatabaseUserPermissionCheck)->addData($input); + $result = (new DatabaseUserPermissionCheck())->addData($input); self::assertSame(Permission::ALL, $result['userPermissionOnPage']); } @@ -490,6 +490,6 @@ class DatabaseUserPermissionCheckTest extends UnitTestCase $this->expectException(AccessDeniedRootNodeException::class); $this->expectExceptionCode(1437745221); - (new DatabaseUserPermissionCheck)->addData($input); + (new DatabaseUserPermissionCheck())->addData($input); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaCheckboxItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaCheckboxItemsTest.php index b3f71b61cc612a739863dae3a5aba63da5917fce..cbd6f6530613d954f4bae04236e985bced7ff520 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaCheckboxItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaCheckboxItemsTest.php @@ -410,7 +410,7 @@ class TcaCheckboxItemsTest extends UnitTestCase $GLOBALS['LANG'] = $languageService->reveal(); $languageService->sL(Argument::cetera())->willReturnArgument(0); - self::assertSame($expectedResult, (new TcaCheckboxItems)->addData($input)); + self::assertSame($expectedResult, (new TcaCheckboxItems())->addData($input)); } /** @@ -440,7 +440,7 @@ class TcaCheckboxItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1440499337); - (new TcaCheckboxItems)->addData($input); + (new TcaCheckboxItems())->addData($input); } /** @@ -472,7 +472,7 @@ class TcaCheckboxItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1440499338); - (new TcaCheckboxItems)->addData($input); + (new TcaCheckboxItems())->addData($input); } /** @@ -509,7 +509,7 @@ class TcaCheckboxItemsTest extends UnitTestCase $expected['processedTca']['columns']['aField']['config']['items'][0][0] = 'translated'; $expected['processedTca']['columns']['aField']['config']['items'][0]['invertStateDisplay'] = false; - self::assertSame($expected, (new TcaCheckboxItems)->addData($input)); + self::assertSame($expected, (new TcaCheckboxItems())->addData($input)); } /** @@ -548,7 +548,7 @@ class TcaCheckboxItemsTest extends UnitTestCase 'foo' => 'bar', ], ]; - self::assertSame($expected, (new TcaCheckboxItems)->addData($input)); + self::assertSame($expected, (new TcaCheckboxItems())->addData($input)); } /** @@ -623,7 +623,7 @@ class TcaCheckboxItemsTest extends UnitTestCase // itemsProcFunc must NOT have raised an exception $flashMessageQueue->enqueue($flashMessage)->shouldNotBeCalled(); - (new TcaCheckboxItems)->addData($input); + (new TcaCheckboxItems())->addData($input); } /** @@ -682,7 +682,7 @@ class TcaCheckboxItemsTest extends UnitTestCase $flashMessageQueue->enqueue($flashMessage)->shouldBeCalled(); - (new TcaCheckboxItems)->addData($input); + (new TcaCheckboxItems())->addData($input); } /** @@ -731,6 +731,6 @@ class TcaCheckboxItemsTest extends UnitTestCase $expected['processedTca']['columns']['aField']['config']['items'][0][0] = 'labelOverride'; $expected['processedTca']['columns']['aField']['config']['items'][0]['invertStateDisplay'] = false; - self::assertSame($expected, (new TcaCheckboxItems)->addData($input)); + self::assertSame($expected, (new TcaCheckboxItems())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php index 627036b57d55f48dca64adc310d3c253fc32785d..cde0a35501bb07ae3e87357575a249461f442391 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php @@ -40,7 +40,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['t3_origuid']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -60,7 +60,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['doktype']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -80,7 +80,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['relation_field']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -100,7 +100,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['sys_language_uid']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -120,7 +120,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['l10n_parent']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -140,7 +140,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['l18n_diffsource']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -169,7 +169,7 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['aField']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } /** @@ -198,6 +198,6 @@ class TcaColumnsProcessCommonTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['aField', 'bField']; - self::assertSame($expected, (new TcaColumnsProcessCommon)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessCommon())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessFieldLabelsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessFieldLabelsTest.php index 923b9ce06eab3baba5650d3ceb4c7ae3b4762f64..003fff3f2bbea945168aadc27a4c513c4c9d343a 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessFieldLabelsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessFieldLabelsTest.php @@ -45,7 +45,7 @@ class TcaColumnsProcessFieldLabelsTest extends UnitTestCase $GLOBALS['LANG'] = $languageServiceProphecy->reveal(); $expected = $input; - self::assertSame($expected, (new TcaColumnsProcessFieldLabels)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessFieldLabels())->addData($input)); } /** @@ -75,7 +75,7 @@ class TcaColumnsProcessFieldLabelsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['label'] = 'aLabelOverride'; - self::assertSame($expected, (new TcaColumnsProcessFieldLabels)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessFieldLabels())->addData($input)); } /** @@ -110,7 +110,7 @@ class TcaColumnsProcessFieldLabelsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['label'] = 'aLabelOverride'; - self::assertSame($expected, (new TcaColumnsProcessFieldLabels)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessFieldLabels())->addData($input)); } /** @@ -144,7 +144,7 @@ class TcaColumnsProcessFieldLabelsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['label'] = 'aLabelOverride'; - self::assertSame($expected, (new TcaColumnsProcessFieldLabels)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessFieldLabels())->addData($input)); } /** @@ -181,6 +181,6 @@ class TcaColumnsProcessFieldLabelsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['label'] = 'aLabelOverride'; - self::assertSame($expected, (new TcaColumnsProcessFieldLabels)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessFieldLabels())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php index 23852e45822cd32a230b02a225efb4c9576177f3..84682050a7d7608550a59115358d3303567fc688 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php @@ -41,7 +41,7 @@ class TcaColumnsProcessRecordTitleTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['uid']; - self::assertSame($expected, (new TcaColumnsProcessRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessRecordTitle())->addData($input)); } /** @@ -63,7 +63,7 @@ class TcaColumnsProcessRecordTitleTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['uid', 'aField', 'anotherField']; - self::assertSame($expected, (new TcaColumnsProcessRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessRecordTitle())->addData($input)); } /** @@ -81,7 +81,7 @@ class TcaColumnsProcessRecordTitleTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = [ 'aForeignLabelField' ]; - self::assertSame($expected, (new TcaColumnsProcessRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessRecordTitle())->addData($input)); } /** @@ -99,6 +99,6 @@ class TcaColumnsProcessRecordTitleTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = [ 'aSymmetricLabelField' ]; - self::assertSame($expected, (new TcaColumnsProcessRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessRecordTitle())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php index b317df131fe10d2cdb248a07b46e3a19508eda0c..62b040b885a77ab0c148a9b9e5df9eb3b1b30b60 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php @@ -44,7 +44,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438614542); - (new TcaColumnsProcessShowitem)->addData($input); + (new TcaColumnsProcessShowitem())->addData($input); } /** @@ -81,7 +81,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['keepMe']; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } /** @@ -123,7 +123,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['keepMe']; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } /** @@ -169,7 +169,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase $expected = $input; $expected['columnsToProcess'] = ['aField', 'anotherField']; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } /** @@ -206,7 +206,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase 'inlineExpandCollapseStateArray' => [], ]; $expected = $input; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } /** @@ -250,7 +250,7 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase ], ]; $expected = $input; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } /** @@ -292,6 +292,6 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase ]; $expected = $input; $expected['columnsToProcess'] = ['aField']; - self::assertSame($expected, (new TcaColumnsProcessShowitem)->addData($input)); + self::assertSame($expected, (new TcaColumnsProcessShowitem())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php index 2f18aeab8990a6da66d47c0acb9b322a9133cfbd..bc7d05ab69a3281948c1f3e64bba41e9456409c2 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php @@ -89,7 +89,7 @@ class TcaFlexPrepareTest extends UnitTestCase ], ]; $expected = $input; - self::assertEquals($expected, (new TcaFlexPrepare)->addData($input)); + self::assertEquals($expected, (new TcaFlexPrepare())->addData($input)); } /** @@ -160,7 +160,7 @@ class TcaFlexPrepareTest extends UnitTestCase 'meta' => [], ]; - self::assertEquals($expected, (new TcaFlexPrepare)->addData($input)); + self::assertEquals($expected, (new TcaFlexPrepare())->addData($input)); } /** @@ -239,7 +239,7 @@ class TcaFlexPrepareTest extends UnitTestCase 'meta' => [], ]; - self::assertEquals($expected, (new TcaFlexPrepare)->addData($input)); + self::assertEquals($expected, (new TcaFlexPrepare())->addData($input)); } /** @@ -283,6 +283,6 @@ class TcaFlexPrepareTest extends UnitTestCase 'meta' => [] ]; - self::assertEquals($expected, (new TcaFlexPrepare)->addData($input)); + self::assertEquals($expected, (new TcaFlexPrepare())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaGroupTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaGroupTest.php index 77aa713318de5d6a6101391c8630b735072f6d46..7fc9de448edcc01c27a7879428f86f26b67fabc5 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaGroupTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaGroupTest.php @@ -55,7 +55,7 @@ class TcaGroupTest extends UnitTestCase ], ]; $expected = $input; - self::assertSame($expected, (new TcaGroup)->addData($input)); + self::assertSame($expected, (new TcaGroup())->addData($input)); } /** @@ -78,7 +78,7 @@ class TcaGroupTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438780511); - (new TcaGroup)->addData($input); + (new TcaGroup())->addData($input); } /** @@ -120,7 +120,7 @@ class TcaGroupTest extends UnitTestCase ] ]; $expected['processedTca']['columns']['aField']['config']['clipboardElements'] = []; - self::assertSame($expected, (new TcaGroup)->addData($input)); + self::assertSame($expected, (new TcaGroup())->addData($input)); } /** @@ -191,6 +191,6 @@ class TcaGroupTest extends UnitTestCase ]; $expected['processedTca']['columns']['aField']['config']['clipboardElements'] = []; - self::assertSame($expected, (new TcaGroup)->addData($input)); + self::assertSame($expected, (new TcaGroup())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineConfigurationTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineConfigurationTest.php index 758fefaa6d05fa40931e63e0fbab939165008aaa..af46c09d4abc0cd6577988b5baf0ae28ed790f88 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineConfigurationTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineConfigurationTest.php @@ -67,7 +67,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1443793404); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -89,7 +89,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -113,7 +113,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['minitems'] = 23; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -137,7 +137,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['minitems'] = 0; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -161,7 +161,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['maxitems'] = 23; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -185,7 +185,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['maxitems'] = 1; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -215,7 +215,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'both'; $expected['processedTca']['columns']['aField']['config']['appearance']['enabledControls']['dragdrop'] = false; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -257,7 +257,7 @@ class TcaInlineConfigurationTest extends UnitTestCase 'foreignTable' => 'anotherForeignTableName', ]; $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'none'; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -301,7 +301,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $expected['processedTca']['columns']['aField']['config']['appearance']['useCombination'] = true; $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'both'; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -327,7 +327,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['appearance']['showPossibleLocalizationRecords'] = true; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -353,7 +353,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['appearance']['showPossibleLocalizationRecords'] = false; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -379,7 +379,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['appearance']['showRemovedLocalizationRecords'] = true; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -405,7 +405,7 @@ class TcaInlineConfigurationTest extends UnitTestCase $expected = []; $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig; $expected['processedTca']['columns']['aField']['config']['appearance']['showRemovedLocalizationRecords'] = false; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -430,7 +430,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444995464); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -454,7 +454,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444996537); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -478,7 +478,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444996537); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -505,7 +505,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444996537); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -533,7 +533,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1444999130); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -560,7 +560,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1445078627); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -588,7 +588,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1445078628); - (new TcaInlineConfiguration)->addData($input); + (new TcaInlineConfiguration())->addData($input); } /** @@ -626,7 +626,7 @@ class TcaInlineConfigurationTest extends UnitTestCase ], 'foreignTable' => 'anotherForeignTableName', ]; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } /** @@ -702,6 +702,6 @@ class TcaInlineConfigurationTest extends UnitTestCase ], 'foreignTable' => 'anotherForeignTableName', ]; - self::assertEquals($expected, (new TcaInlineConfiguration)->addData($input)); + self::assertEquals($expected, (new TcaInlineConfiguration())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineExpandCollapseStateTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineExpandCollapseStateTest.php index 6eeabc68a8515f59521d7bde8e494af78495a1d0..6d6af97976eb2fede24af9df31d4baf13bc21b85 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineExpandCollapseStateTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineExpandCollapseStateTest.php @@ -58,7 +58,7 @@ class TcaInlineExpandCollapseStateTest extends UnitTestCase ]; $expected = $input; $expected['inlineExpandCollapseStateArray'] = $inlineState['aParentTable'][5]; - self::assertSame($expected, (new TcaInlineExpandCollapseState)->addData($input)); + self::assertSame($expected, (new TcaInlineExpandCollapseState())->addData($input)); } /** @@ -102,7 +102,7 @@ class TcaInlineExpandCollapseStateTest extends UnitTestCase ]; $expected = $input; $expected['inlineExpandCollapseStateArray'] = $inlineState['aParentTable'][5]; - self::assertSame($expected, (new TcaInlineExpandCollapseState)->addData($input)); + self::assertSame($expected, (new TcaInlineExpandCollapseState())->addData($input)); } /** @@ -335,6 +335,6 @@ class TcaInlineExpandCollapseStateTest extends UnitTestCase $expected = $input; $expected['isInlineChildExpanded'] = $expectedIsInlineChildExpanded; - self::assertSame($expected, (new TcaInlineExpandCollapseState)->addData($input)); + self::assertSame($expected, (new TcaInlineExpandCollapseState())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineTest.php index 5d7f565ee5f1e8be0fb401d30e58957425d1ec83..1f77c5aa622b631bd921a5cb4cc3330b4b322dc6 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineTest.php @@ -66,7 +66,7 @@ class TcaInlineTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['children'] = []; - self::assertEquals($expected, (new TcaInline)->addData($input)); + self::assertEquals($expected, (new TcaInline())->addData($input)); } /** @@ -97,7 +97,7 @@ class TcaInlineTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['type'] = 'input'; - self::assertEquals($expected, (new TcaInline)->addData($input)); + self::assertEquals($expected, (new TcaInline())->addData($input)); } /** @@ -130,6 +130,6 @@ class TcaInlineTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['children'] = []; - self::assertEquals($expected, (new TcaInline)->addData($input)); + self::assertEquals($expected, (new TcaInline())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInputPlaceholdersTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInputPlaceholdersTest.php index a86ced5c1ce5b3b5a5dc481727abf550bdaef65d..7717ce9cdc2fe7811589a569231aa499fb6a1755 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInputPlaceholdersTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInputPlaceholdersTest.php @@ -51,7 +51,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; unset($expected['processedTca']['columns']['aField']['config']['placeholder']); - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -76,7 +76,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -104,7 +104,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['placeholder'] = 'anotherPlaceholder'; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -168,7 +168,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['placeholder'] = $aForeignTableInput['databaseRow']['aForeignField']; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -203,7 +203,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; unset($expected['processedTca']['columns']['aField']['config']['placeholder']); - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -277,7 +277,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['placeholder'] = $sysFileProphecyResult['databaseRow']['sha1']; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -343,7 +343,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['placeholder'] = $sysFileMetadataProphecyResult['databaseRow']['title']; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -447,7 +447,7 @@ class TcaInputPlaceholdersTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['placeholder'] = $sysFileMetadataProphecyResult['databaseRow']['title']; - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } /** @@ -479,6 +479,6 @@ class TcaInputPlaceholdersTest extends UnitTestCase $GLOBALS['LANG'] = $languageService->reveal(); $languageService->sL($labelString)->shouldBeCalled()->willReturn($localizedString); - self::assertSame($expected, (new TcaInputPlaceholders)->addData($input)); + self::assertSame($expected, (new TcaInputPlaceholders())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRadioItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRadioItemsTest.php index 90713f6de622f2076db9b0c33bb8baf7a09f2c0e..bff6ff6ca43433e31ffabd7b96baf9678abd3d61 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRadioItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRadioItemsTest.php @@ -63,7 +63,7 @@ class TcaRadioItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438594829); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -94,7 +94,7 @@ class TcaRadioItemsTest extends UnitTestCase $languageService->sL(Argument::cetera())->willReturnArgument(0); $expected = $input; - self::assertSame($expected, (new TcaRadioItems)->addData($input)); + self::assertSame($expected, (new TcaRadioItems())->addData($input)); } /** @@ -124,7 +124,7 @@ class TcaRadioItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438607163); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -156,7 +156,7 @@ class TcaRadioItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438607164); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -188,7 +188,7 @@ class TcaRadioItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1438607165); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -224,8 +224,8 @@ class TcaRadioItemsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['items'][0][0] = 'translated'; - self::assertSame($expected, (new TcaRadioItems)->addData($input)); - (new TcaRadioItems)->addData($input); + self::assertSame($expected, (new TcaRadioItems())->addData($input)); + (new TcaRadioItems())->addData($input); } /** @@ -264,7 +264,7 @@ class TcaRadioItemsTest extends UnitTestCase 'foo' => 'bar', ], ]; - self::assertSame($expected, (new TcaRadioItems)->addData($input)); + self::assertSame($expected, (new TcaRadioItems())->addData($input)); } /** @@ -333,7 +333,7 @@ class TcaRadioItemsTest extends UnitTestCase // itemsProcFunc must NOT have raised an exception $flashMessageQueue->enqueue($flashMessage)->shouldNotBeCalled(); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -392,7 +392,7 @@ class TcaRadioItemsTest extends UnitTestCase $flashMessageQueue->enqueue($flashMessage)->shouldBeCalled(); - (new TcaRadioItems)->addData($input); + (new TcaRadioItems())->addData($input); } /** @@ -440,7 +440,7 @@ class TcaRadioItemsTest extends UnitTestCase $expected = $input; $expected['processedTca']['columns']['aField']['config']['items'][0][0] = 'labelOverride'; - self::assertSame($expected, (new TcaRadioItems)->addData($input)); - (new TcaRadioItems)->addData($input); + self::assertSame($expected, (new TcaRadioItems())->addData($input)); + (new TcaRadioItems())->addData($input); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRecordTitleTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRecordTitleTest.php index 496ad5005b189f17fd96e53e8e6b06830658856f..6ef6044a046dbad2afe8e0197855bc85709e6a8c 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRecordTitleTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRecordTitleTest.php @@ -58,7 +58,7 @@ class TcaRecordTitleTest extends UnitTestCase ]; $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1443706103); - (new TcaRecordTitle)->addData($input); + (new TcaRecordTitle())->addData($input); } /** @@ -84,7 +84,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'Test'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -116,7 +116,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'Test'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -152,7 +152,7 @@ class TcaRecordTitleTest extends UnitTestCase ]; $expected = $input; $expected['recordTitle'] = 'aValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -189,7 +189,7 @@ class TcaRecordTitleTest extends UnitTestCase ]; $expected = $input; $expected['recordTitle'] = 'aFormattedLabel'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -222,7 +222,7 @@ class TcaRecordTitleTest extends UnitTestCase ]; $expected = $input; $expected['recordTitle'] = 'aValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -251,7 +251,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'NEW56017ee37d10e587251374'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -400,7 +400,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = $expectedTitle; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -438,7 +438,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'anotherValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -482,7 +482,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'additionalValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -521,7 +521,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'aField, anotherField'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -566,7 +566,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'aField, anotherField, additionalValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -611,7 +611,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'aField, additionalValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -647,7 +647,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'bar'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -684,7 +684,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'foo'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -824,7 +824,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = $expectedTitle; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -868,7 +868,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'aValue, anotherValue'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -903,7 +903,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -943,7 +943,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'foo, baz'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -1001,7 +1001,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = ''; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -1039,7 +1039,7 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'foo, bar'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } /** @@ -1069,6 +1069,6 @@ class TcaRecordTitleTest extends UnitTestCase $expected = $input; $expected['recordTitle'] = 'text'; - self::assertSame($expected, (new TcaRecordTitle)->addData($input)); + self::assertSame($expected, (new TcaRecordTitle())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php index 415d400c4492cecdb82986557f7140245e6e9b1f..10fa53b1edeb76c537e38d21e15bd7b1e454f0ce 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php @@ -203,7 +203,7 @@ class TcaSelectItemsTest extends UnitTestCase ]; $expected = $input; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -231,7 +231,7 @@ class TcaSelectItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1439288036); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -277,7 +277,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = ['aValue']; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -314,7 +314,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = ['aValue']; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -340,7 +340,7 @@ class TcaSelectItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1439298496); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -402,7 +402,7 @@ class TcaSelectItemsTest extends UnitTestCase ] ]; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -464,7 +464,7 @@ class TcaSelectItemsTest extends UnitTestCase ] ]; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -608,7 +608,7 @@ class TcaSelectItemsTest extends UnitTestCase ]; $GLOBALS['TCA'] = $tca; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -687,7 +687,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -758,7 +758,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -829,7 +829,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -921,7 +921,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -1013,7 +1013,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -1065,7 +1065,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -1128,7 +1128,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -1186,7 +1186,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); $result['processedTca']['columns']['aField']['config']['items'][0][2] = str_replace([CR, LF, "\t"], '', $result['processedTca']['columns']['aField']['config']['items'][0][2]); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); @@ -1239,7 +1239,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - $result = (new TcaSelectItems)->addData($input); + $result = (new TcaSelectItems())->addData($input); self::assertSame($expectedItems, $result['processedTca']['columns']['aField']['config']['items']); } @@ -1267,7 +1267,7 @@ class TcaSelectItemsTest extends UnitTestCase $this->expectException(\RuntimeException::class); $this->expectExceptionCode(1479399227); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -1321,7 +1321,7 @@ class TcaSelectItemsTest extends UnitTestCase null, ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -1375,7 +1375,7 @@ class TcaSelectItemsTest extends UnitTestCase null, ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -1699,7 +1699,7 @@ class TcaSelectItemsTest extends UnitTestCase $GLOBALS['BE_USER'] = $backendUserProphecy->reveal(); $backendUserProphecy->getPagePermsClause(1)->shouldBeCalled()->willReturn(' 1=1'); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -1725,7 +1725,7 @@ class TcaSelectItemsTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1439569743); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -1790,7 +1790,7 @@ class TcaSelectItemsTest extends UnitTestCase GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal()); GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal()); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -1868,7 +1868,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -1975,7 +1975,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2073,7 +2073,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2159,7 +2159,7 @@ class TcaSelectItemsTest extends UnitTestCase ]; $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2217,7 +2217,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['processedTca']['columns']['aField']['config']['items'][2] ); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2268,7 +2268,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; $expected['processedTca']['columns']['aField']['config']['items'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2342,7 +2342,7 @@ class TcaSelectItemsTest extends UnitTestCase ], ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2399,7 +2399,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; unset($expected['processedTca']['columns']['aField']['config']['items'][1]); $expected['processedTca']['columns']['aField']['config']['items'] = array_values($expected['processedTca']['columns']['aField']['config']['items']); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2455,7 +2455,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = []; unset($expected['processedTca']['columns']['aField']['config']['items'][2]); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2509,7 +2509,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; unset($expected['processedTca']['columns']['aField']['config']['items'][1]); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2569,7 +2569,7 @@ class TcaSelectItemsTest extends UnitTestCase [ 'keepMe', 'keep', null, null ], ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2618,7 +2618,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = ['keep']; unset($expected['processedTca']['columns']['aField']['config']['items'][1]); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2660,7 +2660,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['doktype'] = ['keep']; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2710,7 +2710,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['doktype'] = ['keep']; unset($expected['processedTca']['columns']['doktype']['config']['items'][1]); - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2762,7 +2762,7 @@ class TcaSelectItemsTest extends UnitTestCase 'maxitems' => 99999, ]; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2851,7 +2851,7 @@ class TcaSelectItemsTest extends UnitTestCase 0 => '2' // the selected value stored in db ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -2959,7 +2959,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3076,7 +3076,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3201,7 +3201,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3271,7 +3271,7 @@ class TcaSelectItemsTest extends UnitTestCase // itemsProcFunc must NOT have raised an exception $flashMessageQueue->enqueue($flashMessage)->shouldNotBeCalled(); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -3331,7 +3331,7 @@ class TcaSelectItemsTest extends UnitTestCase $flashMessageQueue->enqueue($flashMessage)->shouldBeCalled(); - (new TcaSelectItems)->addData($input); + (new TcaSelectItems())->addData($input); } /** @@ -3387,7 +3387,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected['databaseRow']['aField'] = ['aValue']; $expected['processedTca']['columns']['aField']['config']['items'][0][0] = 'labelOverride'; - self::assertSame($expected, (new TcaSelectItems)->addData($input)); + self::assertSame($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3448,7 +3448,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = $relationHandlerUids; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3507,7 +3507,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = $relationHandlerUids; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3560,7 +3560,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = [1, 'foo']; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3596,7 +3596,7 @@ class TcaSelectItemsTest extends UnitTestCase 'bar' ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3626,7 +3626,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = []; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3663,7 +3663,7 @@ class TcaSelectItemsTest extends UnitTestCase 'c', ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3700,7 +3700,7 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = ['foo']; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3747,7 +3747,7 @@ class TcaSelectItemsTest extends UnitTestCase ['[ INVALID VALUE "1" ]', '1', null, null], ['foo', 'foo', null, null], ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3789,7 +3789,7 @@ class TcaSelectItemsTest extends UnitTestCase 'bar' ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -3830,7 +3830,7 @@ class TcaSelectItemsTest extends UnitTestCase 4 => 'bar', ]; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } /** @@ -4006,6 +4006,6 @@ class TcaSelectItemsTest extends UnitTestCase $expected = $input; $expected['databaseRow']['aField'] = $relationHandlerUids; - self::assertEquals($expected, (new TcaSelectItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectItems())->addData($input)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php index d632e3fde7f0fe7fc2df800d8d50fa531a676210..6f78134380397ad20af89ce2a641f4dd50552fcd 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php @@ -179,7 +179,7 @@ class TcaSelectTreeItemsTest extends UnitTestCase $expected['processedTca']['columns']['aField']['config']['items'] = [ 'fake', 'tree', 'data', ]; - self::assertEquals($expected, (new TcaSelectTreeItems)->addData($input)); + self::assertEquals($expected, (new TcaSelectTreeItems())->addData($input)); } /** @@ -262,7 +262,7 @@ class TcaSelectTreeItemsTest extends UnitTestCase 'selectTreeCompileItems' => true, ]; - (new TcaSelectTreeItems)->addData($input); + (new TcaSelectTreeItems())->addData($input); $treeDataProviderProphecy->setRootUid(42)->shouldHaveBeenCalled(); $treeDataProviderProphecy->setExpandAll(true)->shouldHaveBeenCalled(); diff --git a/typo3/sysext/backend/Tests/Unit/Form/InlineStackProcessorTest.php b/typo3/sysext/backend/Tests/Unit/Form/InlineStackProcessorTest.php index eee13b2d454d6b74496b6fcff3b3fe060622f339..bed60b9bc0f35977623b18535a1134df3ac591fd 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/InlineStackProcessorTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/InlineStackProcessorTest.php @@ -290,7 +290,7 @@ class InlineStackProcessorTest extends UnitTestCase public function getCurrentStructureFormPrefixReturnsExpectedStringAfterInitializationByStructureString($string, array $_, array $expectedFormName) { /** @var InlineStackProcessor|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $subject */ - $subject = new InlineStackProcessor; + $subject = new InlineStackProcessor(); $subject->initializeByParsingDomObjectIdString($string); self::assertEquals($expectedFormName['form'], $subject->getCurrentStructureFormPrefix()); } @@ -302,7 +302,7 @@ class InlineStackProcessorTest extends UnitTestCase public function getCurrentStructureDomObjectIdPrefixReturnsExpectedStringAfterInitializationByStructureString($string, array $_, array $expectedFormName) { /** @var InlineStackProcessor|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $subject */ - $subject = new InlineStackProcessor; + $subject = new InlineStackProcessor(); $subject->initializeByParsingDomObjectIdString($string); self::assertEquals($expectedFormName['object'], $subject->getCurrentStructureDomObjectIdPrefix('pageId')); } diff --git a/typo3/sysext/backend/Tests/Unit/Http/RouteDispatcherTest.php b/typo3/sysext/backend/Tests/Unit/Http/RouteDispatcherTest.php index c47209fca7c31d6f409462c0b35c02ef9e3e31df..02dc429f47738308f299dc1d4cc87a1de6cce019 100644 --- a/typo3/sysext/backend/Tests/Unit/Http/RouteDispatcherTest.php +++ b/typo3/sysext/backend/Tests/Unit/Http/RouteDispatcherTest.php @@ -199,7 +199,7 @@ class RouteDispatcherTest extends UnitTestCase $requestProphecy->withAttribute('target', $target)->willReturn($requestProphecy->reveal()); $containerProphecy = $this->prophesize(ContainerInterface::class); $containerProphecy->has($target)->willReturn(true); - $containerProphecy->get($target)->willReturn(new RouteDispatcherClassInvokeFixture); + $containerProphecy->get($target)->willReturn(new RouteDispatcherClassInvokeFixture()); $this->expectException(\RuntimeException::class); $this->expectExceptionCode(1520756623); diff --git a/typo3/sysext/backend/Tests/Unit/Middleware/SiteResolverTest.php b/typo3/sysext/backend/Tests/Unit/Middleware/SiteResolverTest.php index 7eabfbc0894d00c5ed90707c203c619b2c18d5fe..5d66e8894d6b2f59bacdfaba9ba2b2488766124d 100644 --- a/typo3/sysext/backend/Tests/Unit/Middleware/SiteResolverTest.php +++ b/typo3/sysext/backend/Tests/Unit/Middleware/SiteResolverTest.php @@ -41,7 +41,7 @@ class SiteResolverTest extends UnitTestCase $incomingRequest = new ServerRequest($incomingUrl, 'GET'); $incomingRequest = $incomingRequest->withQueryParams(['id' => '9831:/styleguide/']); - $requestHandler = new class implements RequestHandlerInterface { + $requestHandler = new class() implements RequestHandlerInterface { public $incomingRequest; public function handle(ServerRequestInterface $request): ResponseInterface { diff --git a/typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php b/typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php index 137d211cb29bf256bd3eaff983ccbbb1e66d0260..7dd6a59e49253c985b9d716e916a18c52cc20180 100644 --- a/typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php +++ b/typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php @@ -158,7 +158,7 @@ class MemcachedBackend extends AbstractBackend implements TaggableBackendInterfa throw new Exception('No servers were given to Memcache', 1213115903); } $memcachedPlugin = '\\' . ucfirst($this->usedPeclModule); - $this->memcache = new $memcachedPlugin; + $this->memcache = new $memcachedPlugin(); $defaultPort = $this->usedPeclModule === 'memcache' ? ini_get('memcache.default_port') : 11211; foreach ($this->servers as $server) { if (strpos($server, 'unix://') === 0) { diff --git a/typo3/sysext/core/Classes/Context/UserAspect.php b/typo3/sysext/core/Classes/Context/UserAspect.php index 384a2d1815187d157e3b90f4d69bd03a7eabc715..10d61f6912e9a87493c716f6819b147d1b0ab3f5 100644 --- a/typo3/sysext/core/Classes/Context/UserAspect.php +++ b/typo3/sysext/core/Classes/Context/UserAspect.php @@ -63,7 +63,7 @@ class UserAspect implements AspectInterface */ private function createPseudoUser(): object { - $user = new \stdClass; + $user = new \stdClass(); $user->user = []; return $user; } diff --git a/typo3/sysext/core/Classes/Controller/FileDumpController.php b/typo3/sysext/core/Classes/Controller/FileDumpController.php index af7f19537df31e7e3900160c005e5ae433ed35f9..c81cb021148f2574c7a01ac55b58faf213252baa 100644 --- a/typo3/sysext/core/Classes/Controller/FileDumpController.php +++ b/typo3/sysext/core/Classes/Controller/FileDumpController.php @@ -60,11 +60,11 @@ class FileDumpController $parameters = $this->buildParametersFromRequest($request); if (!$this->isTokenValid($parameters, $request)) { - return (new Response)->withStatus(403); + return (new Response())->withStatus(403); } $file = $this->createFileObjectByParameters($parameters); if ($file === null) { - return (new Response)->withStatus(404); + return (new Response())->withStatus(404); } // Hook: allow some other process to do some security/access checks. Hook should return 403 response if access is rejected, void otherwise diff --git a/typo3/sysext/core/Classes/Core/Bootstrap.php b/typo3/sysext/core/Classes/Core/Bootstrap.php index 8879bd8bbde98756d8d96720b6c66b29a0e2bf0f..935f0d26baabd032cc9911bcfbdf947a4653547a 100644 --- a/typo3/sysext/core/Classes/Core/Bootstrap.php +++ b/typo3/sysext/core/Classes/Core/Bootstrap.php @@ -116,7 +116,7 @@ class Bootstrap $assetsCache = static::createCache('assets', $disableCaching); $dependencyInjectionContainerCache = static::createCache('di'); - $bootState = new \stdClass; + $bootState = new \stdClass(); $bootState->done = false; $bootState->cacheDisabled = $disableCaching; diff --git a/typo3/sysext/core/Classes/Localization/Locales.php b/typo3/sysext/core/Classes/Localization/Locales.php index 6136bf1559b835b078c5923a3a24e72363bdc967..5c880b494631a7d982fc3c809f1d652862b88aa9 100644 --- a/typo3/sysext/core/Classes/Localization/Locales.php +++ b/typo3/sysext/core/Classes/Localization/Locales.php @@ -159,7 +159,7 @@ class Locales implements SingletonInterface public static function initialize(): Locales { trigger_error('Locales::initialize() will be removed in TYPO3 v11.0, fetch the instance of a class via GeneralUtility::makeInstance() or DependencyInjection', E_USER_DEPRECATED); - return new self; + return new self(); } /** diff --git a/typo3/sysext/core/Classes/ServiceProvider.php b/typo3/sysext/core/Classes/ServiceProvider.php index a7a88c2c93a305ddb4f631872d00e4f15b64f68f..fc8a922ec8b23491348aec6e58350c614bd595c5 100644 --- a/typo3/sysext/core/Classes/ServiceProvider.php +++ b/typo3/sysext/core/Classes/ServiceProvider.php @@ -107,17 +107,17 @@ class ServiceProvider extends AbstractServiceProvider public static function getDependencyOrderingService(ContainerInterface $container): Service\DependencyOrderingService { - return new Service\DependencyOrderingService; + return new Service\DependencyOrderingService(); } public static function getContext(ContainerInterface $container): Context\Context { - return new Context\Context; + return new Context\Context(); } public static function getPasswordHashFactory(ContainerInterface $container): Crypto\PasswordHashing\PasswordHashFactory { - return new Crypto\PasswordHashing\PasswordHashFactory; + return new Crypto\PasswordHashing\PasswordHashFactory(); } public static function getMiddlewareStackResolver(ContainerInterface $container): Http\MiddlewareStackResolver diff --git a/typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php b/typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php index b723b21491d9541d8e3ab443fc9459f8e23eb71f..1ac6d991cea42249aedcbb846f5d13057746496f 100644 --- a/typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php +++ b/typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php @@ -93,7 +93,7 @@ class ErrorHandlerTest extends FunctionalTestCase ); $coreErrorHandler->setLogger($logger); - $customErrorHandler = new class { + $customErrorHandler = new class() { protected $existingHandler; public function setExistingHandler($existingHandler) diff --git a/typo3/sysext/core/Tests/Unit/Console/CommandRegistryTest.php b/typo3/sysext/core/Tests/Unit/Console/CommandRegistryTest.php index 8f544d92a63e40c2c6b7ae7810fb8bb0f63bc2b3..f0e11b9957a51fa445da1cd4795946250c6d27f7 100644 --- a/typo3/sysext/core/Tests/Unit/Console/CommandRegistryTest.php +++ b/typo3/sysext/core/Tests/Unit/Console/CommandRegistryTest.php @@ -78,8 +78,8 @@ class CommandRegistryTest extends UnitTestCase $command1MockClass = $this->getMockClass(Command::class, ['dummy']); $command2MockClass = $this->getMockClass(Command::class, ['dummy']); - $this->containerProphecy->get('command1')->willReturn(new $command1MockClass); - $this->containerProphecy->get('command2')->willReturn(new $command2MockClass); + $this->containerProphecy->get('command1')->willReturn(new $command1MockClass()); + $this->containerProphecy->get('command2')->willReturn(new $command2MockClass()); $commandRegistry = new CommandRegistry($this->packageManagerProphecy->reveal(), $this->containerProphecy->reveal()); $commandRegistry->addLazyCommand('test:command', 'command1'); @@ -123,7 +123,7 @@ class CommandRegistryTest extends UnitTestCase $this->packageManagerProphecy->getActivePackages()->willReturn([$package->reveal()]); - $this->containerProphecy->get($commandMockClass)->willReturn(new $commandMockClass); + $this->containerProphecy->get($commandMockClass)->willReturn(new $commandMockClass()); $commandRegistry = new CommandRegistry($this->packageManagerProphecy->reveal(), $this->containerProphecy->reveal()); $commandRegistry->addLazyCommand('first:command', $commandMockClass); diff --git a/typo3/sysext/core/Tests/Unit/DependencyInjection/FailsafeContainerTest.php b/typo3/sysext/core/Tests/Unit/DependencyInjection/FailsafeContainerTest.php index 60ff744bcbc9547213270a18dd5dc2cef3bf081d..80fc3f5550bbf054ba0b531fbe67ed004203ac5b 100644 --- a/typo3/sysext/core/Tests/Unit/DependencyInjection/FailsafeContainerTest.php +++ b/typo3/sysext/core/Tests/Unit/DependencyInjection/FailsafeContainerTest.php @@ -54,7 +54,7 @@ class FailsafeContainerTest extends UnitTestCase public function testImplementsInterface(): void { - self::assertInstanceOf(ContainerInterface::class, new Container); + self::assertInstanceOf(ContainerInterface::class, new Container()); } public function testWithString(): void @@ -378,7 +378,7 @@ class FailsafeContainerTest extends UnitTestCase public function testNullContainer(): void { - $container = new Container; + $container = new Container(); self::assertFalse($container->has('foo')); } @@ -412,7 +412,7 @@ class FailsafeContainerTest extends UnitTestCase ], [ // Invokable - new class { + new class() { public function __invoke(): Service { return new Service(); @@ -422,7 +422,7 @@ class FailsafeContainerTest extends UnitTestCase [ // Non static factory [ - new class { + new class() { public function factory(): Service { return new Service(); diff --git a/typo3/sysext/core/Tests/Unit/DependencyInjection/Fixtures/TestServiceProvider.php b/typo3/sysext/core/Tests/Unit/DependencyInjection/Fixtures/TestServiceProvider.php index 4e59e7907f811f78348b73fb61b569198be1382e..fd143fee8f23550496557a906bb06b6a54946dc2 100644 --- a/typo3/sysext/core/Tests/Unit/DependencyInjection/Fixtures/TestServiceProvider.php +++ b/typo3/sysext/core/Tests/Unit/DependencyInjection/Fixtures/TestServiceProvider.php @@ -40,7 +40,7 @@ class TestServiceProvider implements ServiceProviderInterface 'serviceC' => function (ContainerInterface $container): \stdClass { return new \stdClass(); }, - 'serviceD' => new class { + 'serviceD' => new class() { public function __invoke(ContainerInterface $container): \stdClass { return new \stdClass(); diff --git a/typo3/sysext/core/Tests/Unit/DependencyInjection/ServiceProviderCompilationPassTest.php b/typo3/sysext/core/Tests/Unit/DependencyInjection/ServiceProviderCompilationPassTest.php index 0bb9c05116a3d60b55a6cb8c35fb9201af5035fe..c3b4c659b5be559273388006c149c38d21a7eb9f 100644 --- a/typo3/sysext/core/Tests/Unit/DependencyInjection/ServiceProviderCompilationPassTest.php +++ b/typo3/sysext/core/Tests/Unit/DependencyInjection/ServiceProviderCompilationPassTest.php @@ -38,14 +38,14 @@ class ServiceProviderCompilationPassTest extends UnitTestCase $serviceProviderRegistryProphecy = $this->prophesize(ServiceProviderRegistry::class); $serviceProviderRegistryProphecy->getIterator()->will(function () use ($serviceProviders): \Generator { foreach ($serviceProviders as $id => $serviceProvider) { - yield (string)$id => new $serviceProvider; + yield (string)$id => new $serviceProvider(); } }); foreach ($serviceProviders as $id => $serviceProvider) { $packageKey = (string)$id; - $instance = new $serviceProvider; + $instance = new $serviceProvider(); $factories = $instance->getFactories(); $extensions = $instance->getExtensions(); @@ -198,7 +198,7 @@ class ServiceProviderCompilationPassTest extends UnitTestCase $this->expectException(\TypeError::class); $registry = new ServiceProviderRegistry([ - new class implements ServiceProviderInterface { + new class() implements ServiceProviderInterface { public function getFactories() { return [ diff --git a/typo3/sysext/core/Tests/Unit/EventDispatcher/EventDispatcherTest.php b/typo3/sysext/core/Tests/Unit/EventDispatcher/EventDispatcherTest.php index 593a620cc1f97a092d380c079624edb4b40cbedd..cc80b497b38c553867e6aeab77a907c86fede949 100644 --- a/typo3/sysext/core/Tests/Unit/EventDispatcher/EventDispatcherTest.php +++ b/typo3/sysext/core/Tests/Unit/EventDispatcher/EventDispatcherTest.php @@ -65,7 +65,7 @@ class EventDispatcherTest extends UnitTestCase */ public function dispatchesEvent(callable $callable) { - $event = new \stdClass; + $event = new \stdClass(); $event->invoked = 0; $this->listenerProviderProphecy->getListenersForEvent($event)->will(function () use ($callable): iterable { @@ -83,7 +83,7 @@ class EventDispatcherTest extends UnitTestCase */ public function doesNotDispatchStoppedEvent(callable $callable) { - $event = new class implements StoppableEventInterface { + $event = new class() implements StoppableEventInterface { public $invoked = 0; public function isPropagationStopped(): bool @@ -107,7 +107,7 @@ class EventDispatcherTest extends UnitTestCase */ public function dispatchesMultipleListeners(callable $callable) { - $event = new \stdClass; + $event = new \stdClass(); $event->invoked = 0; $this->listenerProviderProphecy->getListenersForEvent($event)->will(function () use ($callable): iterable { @@ -126,7 +126,7 @@ class EventDispatcherTest extends UnitTestCase */ public function stopsOnStoppedEvent(callable $callable) { - $event = new class implements StoppableEventInterface { + $event = new class() implements StoppableEventInterface { public $invoked = 0; public $stopped = false; @@ -158,7 +158,7 @@ class EventDispatcherTest extends UnitTestCase $this->expectException(\BadMethodCallException::class); $this->expectExceptionCode(1563270337); - $event = new \stdClass; + $event = new \stdClass(); $this->listenerProviderProphecy->getListenersForEvent($event)->will(function (): iterable { yield function (object $event): void { @@ -178,7 +178,7 @@ class EventDispatcherTest extends UnitTestCase return [ [ // Invokable - new class { + new class() { public function __invoke(object $event): void { $event->invoked += 1; @@ -188,7 +188,7 @@ class EventDispatcherTest extends UnitTestCase [ // Class + method [ - new class { + new class() { public function onEvent(object $event): void { $event->invoked += 1; diff --git a/typo3/sysext/core/Tests/Unit/EventDispatcher/ListenerProviderTest.php b/typo3/sysext/core/Tests/Unit/EventDispatcher/ListenerProviderTest.php index ca6760dd4ab69e292f5305ce7c6357bf76626a69..558e15f19568c665a15225f9432c25cbc0d63767 100644 --- a/typo3/sysext/core/Tests/Unit/EventDispatcher/ListenerProviderTest.php +++ b/typo3/sysext/core/Tests/Unit/EventDispatcher/ListenerProviderTest.php @@ -80,7 +80,7 @@ class ListenerProviderTest extends UnitTestCase */ public function dispatchesEvent($listener, string $method = null) { - $event = new \stdClass; + $event = new \stdClass(); $event->invoked = 0; $this->containerProphecy->get('listener')->willReturn($listener); @@ -99,7 +99,7 @@ class ListenerProviderTest extends UnitTestCase */ public function associatesToEventParentClass($listener, string $method = null) { - $extendedEvent = new class extends \stdClass { + $extendedEvent = new class() extends \stdClass { public $invoked = 0; }; @@ -118,12 +118,12 @@ class ListenerProviderTest extends UnitTestCase */ public function associatesToImplementedInterfaces($listener, string $method = null) { - $eventImplementation = new class implements \IteratorAggregate { + $eventImplementation = new class() implements \IteratorAggregate { public $invoked = 0; public function getIterator(): \Traversable { - throw new \BadMethodCallException; + throw new \BadMethodCallException('Test', 1586942436); } }; @@ -144,7 +144,7 @@ class ListenerProviderTest extends UnitTestCase $this->listenerProvider->addListener(\stdClass::class, 'listener1'); $this->listenerProvider->addListener(\stdClass::class, 'listener2'); - $event = new \stdClass; + $event = new \stdClass(); $event->sequence = ''; $this->containerProphecy->get('listener1')->willReturn(function (object $event): void { $event->sequence .= 'a'; @@ -167,8 +167,8 @@ class ListenerProviderTest extends UnitTestCase $this->expectException(\InvalidArgumentException::class); $this->expectExceptionCode(1549988537); - $event = new \stdClass; - $this->containerProphecy->get('listener')->willReturn(new \stdClass); + $event = new \stdClass(); + $this->containerProphecy->get('listener')->willReturn(new \stdClass()); $this->listenerProvider->addListener(\stdClass::class, 'listener'); foreach ($this->listenerProvider->getListenersForEvent($event) as $listener) { $listener($event); @@ -184,7 +184,7 @@ class ListenerProviderTest extends UnitTestCase return [ [ // Invokable - 'listener' => new class { + 'listener' => new class() { public function __invoke(object $event): void { $event->invoked = 1; @@ -194,7 +194,7 @@ class ListenerProviderTest extends UnitTestCase ], [ // Class + method - 'listener' => new class { + 'listener' => new class() { public function onEvent(object $event): void { $event->invoked = 1; diff --git a/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php b/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php index 34c4f6f94fbbd00d154009c13c293f23b6a341c5..3c068a7c641b96c8b31e8c8876c4f002af681036 100644 --- a/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php +++ b/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php @@ -31,7 +31,7 @@ class AbstractApplicationTest extends UnitTestCase self::markTestSkipped('This test can only be executed if xdebug is present.'); } - $application = new class extends AbstractApplication { + $application = new class() extends AbstractApplication { public function sendResponse(ResponseInterface $response) { parent::sendResponse($response); diff --git a/typo3/sysext/core/Tests/Unit/Http/ClientTest.php b/typo3/sysext/core/Tests/Unit/Http/ClientTest.php index b0cde359692df6b12e3ff19958de819f1e62c0dc..3d68a5f10da661730c714c6f279b9338e7e273cc 100644 --- a/typo3/sysext/core/Tests/Unit/Http/ClientTest.php +++ b/typo3/sysext/core/Tests/Unit/Http/ClientTest.php @@ -115,7 +115,7 @@ class ClientTest extends UnitTestCase { $request = new Request('https://example.com', 'GET', 'php://temp'); $mock = new GuzzleMockHandler([ - new class extends \RuntimeException implements GuzzleExceptionInterface { + new class() extends \RuntimeException implements GuzzleExceptionInterface { } ]); $handler = GuzzleHandlerStack::create($mock); diff --git a/typo3/sysext/core/Tests/Unit/Http/MiddlewareDispatcherTest.php b/typo3/sysext/core/Tests/Unit/Http/MiddlewareDispatcherTest.php index 77d770420f18ab56e25c44c218bf751a6e1f1c9e..00db87aec4412626d9e68d7a742f74c786170f32 100644 --- a/typo3/sysext/core/Tests/Unit/Http/MiddlewareDispatcherTest.php +++ b/typo3/sysext/core/Tests/Unit/Http/MiddlewareDispatcherTest.php @@ -38,15 +38,15 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function executesKernelWithEmptyMiddlewareStack() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return (new Response)->withStatus(204); + return (new Response())->withStatus(204); } }; $dispatcher = new MiddlewareDispatcher($kernel); - $response = $dispatcher->handle(new ServerRequest); + $response = $dispatcher->handle(new ServerRequest()); self::assertSame(204, $response->getStatusCode()); } @@ -56,16 +56,16 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function executesMiddlewaresLastInFirstOut() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return (new Response) + return (new Response()) ->withStatus(204) ->withHeader('X-SEQ-PRE-REQ-HANDLER', $request->getHeader('X-SEQ-PRE-REQ-HANDLER')); } }; - $middleware1 = new class implements MiddlewareInterface { + $middleware1 = new class() implements MiddlewareInterface { public $id = '0'; public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface @@ -89,7 +89,7 @@ class MiddlewareDispatcherTest extends UnitTestCase $dispatcher->lazy(MiddlewareFixture::class); $dispatcher->add($middleware4); - $response = $dispatcher->handle(new ServerRequest); + $response = $dispatcher->handle(new ServerRequest()); self::assertSame(['3', '2', '1', '0'], $response->getHeader('X-SEQ-PRE-REQ-HANDLER')); self::assertSame(['0', '1', '2', '3'], $response->getHeader('X-SEQ-POST-REQ-HANDLER')); @@ -101,22 +101,22 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function doesNotInstantiateLazyMiddlewareInCaseOfAnEarlyReturningOuterMiddleware() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return new Response; + return new Response(); } }; - $middleware = new class implements MiddlewareInterface { + $middleware = new class() implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - return (new Response)->withStatus(404); + return (new Response())->withStatus(404); } }; MiddlewareFixture::$hasBeenInstantiated = false; $dispatcher = new MiddlewareDispatcher($kernel, [MiddlewareFixture::class, $middleware]); - $response = $dispatcher->handle(new ServerRequest); + $response = $dispatcher->handle(new ServerRequest()); self::assertFalse(MiddlewareFixture::$hasBeenInstantiated); self::assertSame(404, $response->getStatusCode()); @@ -130,17 +130,17 @@ class MiddlewareDispatcherTest extends UnitTestCase $this->expectException(\InvalidArgumentException::class); $this->expectExceptionCode(1516821342); - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return new Response; + return new Response(); } }; MiddlewareFixture::$hasBeenInstantiated = false; $dispatcher = new MiddlewareDispatcher($kernel); $dispatcher->lazy(\stdClass::class); - $dispatcher->handle(new ServerRequest); + $dispatcher->handle(new ServerRequest()); } /** @@ -148,24 +148,24 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function canBeExecutedMultipleTimes() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return new Response; + return new Response(); } }; - $middleware = new class implements MiddlewareInterface { + $middleware = new class() implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - return (new Response)->withStatus(204); + return (new Response())->withStatus(204); } }; $dispatcher = new MiddlewareDispatcher($kernel); $dispatcher->add($middleware); - $response1 = $dispatcher->handle(new ServerRequest); - $response2 = $dispatcher->handle(new ServerRequest); + $response1 = $dispatcher->handle(new ServerRequest()); + $response2 = $dispatcher->handle(new ServerRequest()); self::assertSame(204, $response1->getStatusCode()); self::assertSame(204, $response2->getStatusCode()); @@ -176,10 +176,10 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function canBeReExecutedRecursivelyDuringDispatch() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return new Response; + return new Response(); } }; @@ -196,7 +196,7 @@ class MiddlewareDispatcherTest extends UnitTestCase public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($request->hasHeader('X-NESTED')) { - return (new Response)->withStatus(204)->withAddedHeader('X-TRACE', 'nested'); + return (new Response())->withStatus(204)->withAddedHeader('X-TRACE', 'nested'); } $response = $this->dispatcher->handle($request->withAddedHeader('X-NESTED', '1')); @@ -205,7 +205,7 @@ class MiddlewareDispatcherTest extends UnitTestCase } }); - $response = $dispatcher->handle(new ServerRequest); + $response = $dispatcher->handle(new ServerRequest()); self::assertSame(204, $response->getStatusCode()); self::assertSame(['nested', 'outer'], $response->getHeader('X-TRACE')); @@ -216,17 +216,17 @@ class MiddlewareDispatcherTest extends UnitTestCase */ public function fetchesMiddlewareFromContainer() { - $kernel = new class implements RequestHandlerInterface { + $kernel = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - return new Response; + return new Response(); } }; - $middleware = new class implements MiddlewareInterface { + $middleware = new class() implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - return (new Response)->withStatus(404); + return (new Response())->withStatus(404); } }; @@ -236,7 +236,7 @@ class MiddlewareDispatcherTest extends UnitTestCase $containerProphecy->get('somemiddlewarename')->willReturn($middleware); $dispatcher = new MiddlewareDispatcher($kernel, ['somemiddlewarename'], $containerProphecy->reveal()); - $response = $dispatcher->handle(new ServerRequest); + $response = $dispatcher->handle(new ServerRequest()); self::assertSame(404, $response->getStatusCode()); } diff --git a/typo3/sysext/core/Tests/Unit/Http/MiddlewareStackResolverTest.php b/typo3/sysext/core/Tests/Unit/Http/MiddlewareStackResolverTest.php index 839c3ac7a49a8be081b6d69b6b44e7374f5593fc..77f7bf2aab5378da9fda85f8f6d02c3dc879561f 100644 --- a/typo3/sysext/core/Tests/Unit/Http/MiddlewareStackResolverTest.php +++ b/typo3/sysext/core/Tests/Unit/Http/MiddlewareStackResolverTest.php @@ -66,7 +66,7 @@ class MiddlewareStackResolverTest extends UnitTestCase */ public function resolveReturnsEmptyMiddlewareStackForZeroPackages() { - $middlewares = new ArrayObject; + $middlewares = new ArrayObject(); $containerProphecy = $this->prophesize(); $containerProphecy->willImplement(ContainerInterface::class); $containerProphecy->get('middlewares')->willReturn($middlewares); diff --git a/typo3/sysext/core/Tests/Unit/Imaging/IconRegistryTest.php b/typo3/sysext/core/Tests/Unit/Imaging/IconRegistryTest.php index 6230f00cd700645ad8da703ecde1221412c52199..6c6f0463f5bd49a419cf5f2b783f76383f5601d9 100644 --- a/typo3/sysext/core/Tests/Unit/Imaging/IconRegistryTest.php +++ b/typo3/sysext/core/Tests/Unit/Imaging/IconRegistryTest.php @@ -57,7 +57,7 @@ class IconRegistryTest extends UnitTestCase */ public function getDefaultIconIdentifierReturnsTheCorrectDefaultIconIdentifierString() { - $result = (new IconRegistry)->getDefaultIconIdentifier(); + $result = (new IconRegistry())->getDefaultIconIdentifier(); self::assertEquals($result, 'default-not-found'); } @@ -76,7 +76,7 @@ class IconRegistryTest extends UnitTestCase */ public function isRegisteredReturnsFalseForNotRegisteredIcon() { - $result = (new IconRegistry)->isRegistered($this->notRegisteredIconIdentifier); + $result = (new IconRegistry())->isRegistered($this->notRegisteredIconIdentifier); self::assertEquals($result, false); } @@ -103,7 +103,7 @@ class IconRegistryTest extends UnitTestCase $this->expectException(\InvalidArgumentException::class); $this->expectExceptionCode(1437425803); - (new IconRegistry)->registerIcon($this->notRegisteredIconIdentifier, GeneralUtility::class); + (new IconRegistry())->registerIcon($this->notRegisteredIconIdentifier, GeneralUtility::class); } /** @@ -114,7 +114,7 @@ class IconRegistryTest extends UnitTestCase $this->expectException(\TYPO3\CMS\Core\Exception::class); $this->expectExceptionCode(1437425804); - (new IconRegistry)->getIconConfigurationByIdentifier($this->notRegisteredIconIdentifier); + (new IconRegistry())->getIconConfigurationByIdentifier($this->notRegisteredIconIdentifier); } /** @@ -122,7 +122,7 @@ class IconRegistryTest extends UnitTestCase */ public function getIconConfigurationByIdentifierReturnsCorrectConfiguration() { - $result = (new IconRegistry)->getIconConfigurationByIdentifier('default-not-found'); + $result = (new IconRegistry())->getIconConfigurationByIdentifier('default-not-found'); // result must contain at least provider and options array self::assertArrayHasKey('provider', $result); self::assertArrayHasKey('options', $result); @@ -135,7 +135,7 @@ class IconRegistryTest extends UnitTestCase */ public function getAllRegisteredIconIdentifiersReturnsAnArrayWithIconIdentifiers() { - self::assertIsArray((new IconRegistry)->getAllRegisteredIconIdentifiers()); + self::assertIsArray((new IconRegistry())->getAllRegisteredIconIdentifiers()); } /** @@ -143,7 +143,7 @@ class IconRegistryTest extends UnitTestCase */ public function getAllRegisteredIconIdentifiersReturnsArrayWithAllRegisteredIconIdentifiers() { - $result = (new IconRegistry)->getAllRegisteredIconIdentifiers(); + $result = (new IconRegistry())->getAllRegisteredIconIdentifiers(); self::assertIsArray($result); self::assertContains('default-not-found', $result); } @@ -153,7 +153,7 @@ class IconRegistryTest extends UnitTestCase */ public function getIconIdentifierForFileExtensionReturnsDefaultIconIdentifierForEmptyFileExtension() { - $result = (new IconRegistry)->getIconIdentifierForFileExtension(''); + $result = (new IconRegistry())->getIconIdentifierForFileExtension(''); self::assertEquals('mimetypes-other-other', $result); } @@ -162,7 +162,7 @@ class IconRegistryTest extends UnitTestCase */ public function getIconIdentifierForFileExtensionReturnsDefaultIconIdentifierForUnknownFileExtension() { - $result = (new IconRegistry)->getIconIdentifierForFileExtension('xyz'); + $result = (new IconRegistry())->getIconIdentifierForFileExtension('xyz'); self::assertEquals('mimetypes-other-other', $result); } @@ -171,7 +171,7 @@ class IconRegistryTest extends UnitTestCase */ public function getIconIdentifierForFileExtensionReturnsImageIconIdentifierForImageFileExtension() { - $result = (new IconRegistry)->getIconIdentifierForFileExtension('jpg'); + $result = (new IconRegistry())->getIconIdentifierForFileExtension('jpg'); self::assertEquals('mimetypes-media-image', $result); } @@ -224,7 +224,7 @@ class IconRegistryTest extends UnitTestCase */ public function getIconIdentifierForMimeTypeWithUnknownMimeTypeReturnNull() { - $result = (new IconRegistry)->getIconIdentifierForMimeType('bar/foo'); + $result = (new IconRegistry())->getIconIdentifierForMimeType('bar/foo'); self::assertNull($result); } } diff --git a/typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php b/typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php index 3fdce5fa202b5d136dadfcadbbc595db27ee9cae..fe6244ce82f3752af3a3d49a67179b8bc56afc4a 100644 --- a/typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php +++ b/typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php @@ -80,7 +80,7 @@ class LocalesTest extends UnitTestCase */ public function browserLanguageDetectionWorks(string $acceptLanguageHeader, string $expected) { - $detectedLanguage = (new Locales)->getPreferredClientLanguage( + $detectedLanguage = (new Locales())->getPreferredClientLanguage( $acceptLanguageHeader ); self::assertSame($expected, $detectedLanguage); diff --git a/typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php b/typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php index a000cd0d1b4ee525d5d6978ba1d943877d51fb39..6f99e629244e7ffd97cc3222a60ec746262b757a 100644 --- a/typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php +++ b/typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php @@ -72,7 +72,7 @@ class XliffParserTest extends UnitTestCase */ public function canParseXliffInEnglish() { - $LOCAL_LANG = (new XliffParser)->getParsedData($this->xliffFileNames['locallang'], 'default'); + $LOCAL_LANG = (new XliffParser())->getParsedData($this->xliffFileNames['locallang'], 'default'); self::assertArrayHasKey('default', $LOCAL_LANG, 'default key not found in $LOCAL_LANG'); $expectedLabels = [ 'label1' => 'This is label #1', @@ -89,7 +89,7 @@ class XliffParserTest extends UnitTestCase */ public function canParseXliffInFrench() { - $LOCAL_LANG = (new XliffParser)->getParsedData($this->xliffFileNames['locallang'], 'fr'); + $LOCAL_LANG = (new XliffParser())->getParsedData($this->xliffFileNames['locallang'], 'fr'); self::assertArrayHasKey('fr', $LOCAL_LANG, 'fr key not found in $LOCAL_LANG'); $expectedLabels = [ 'label1' => 'Ceci est le libellé no. 1', @@ -107,7 +107,7 @@ class XliffParserTest extends UnitTestCase public function canOverrideXliff() { /** @var $factory LocalizationFactory */ - $factory = new LocalizationFactory; + $factory = new LocalizationFactory(); $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$this->xliffFileNames['locallang']][] = $this->xliffFileNames['locallang_override']; $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['fr'][$this->xliffFileNames['locallang']][] = $this->xliffFileNames['locallang_override_fr']; @@ -144,7 +144,7 @@ class XliffParserTest extends UnitTestCase */ public function canOverrideXliffWithFrenchOnly() { - $factory = new LocalizationFactory; + $factory = new LocalizationFactory(); $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['fr'][$this->xliffFileNames['locallang']][] = $this->xliffFileNames['locallang_override_fr']; $LOCAL_LANG = $factory->getParsedData($this->xliffFileNames['locallang'], 'fr'); diff --git a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php index 53b8da2350045262098b71fab0c43f8c4ec25d2d..4da45e00fe4a69ec8bdf3cda6151083f41800a38 100644 --- a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php +++ b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php @@ -64,7 +64,7 @@ class PackageManagerTest extends UnitTestCase $this->packageManager = $this->getAccessibleMock( PackageManager::class, ['sortAndSavePackageStates', 'sortActivePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'], - [new DependencyOrderingService] + [new DependencyOrderingService()] ); mkdir('vfs://Test/Packages/Application', 0700, true); @@ -143,7 +143,7 @@ class PackageManagerTest extends UnitTestCase file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "typo3-test"}'); } - $packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates'], [new DependencyOrderingService()]); $packageManager->_set('packagesBasePath', 'vfs://Test/Packages/'); $packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php'); @@ -178,7 +178,7 @@ class PackageManagerTest extends UnitTestCase } /** @var PackageManager|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $packageManager */ - $packageManager = $this->getAccessibleMock(PackageManager::class, ['dummy'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['dummy'], [new DependencyOrderingService()]); $packageManager->_set('packagesBasePaths', $packagePaths); $packageManager->_set('packagesBasePath', 'vfs://Test/Packages/'); $packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php'); @@ -221,7 +221,7 @@ class PackageManagerTest extends UnitTestCase } /** @var PackageManager|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $packageManager */ - $packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates', 'registerTransientClassLoadingInformationForPackage'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['sortAndSavePackageStates', 'registerTransientClassLoadingInformationForPackage'], [new DependencyOrderingService()]); $packageManager->_set('packagesBasePaths', $packagePaths); $packageManager->_set('packagesBasePath', 'vfs://Test/Packages/'); $packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php'); @@ -396,7 +396,7 @@ class PackageManagerTest extends UnitTestCase 'imagine/imagine' => 'imagine.Imagine' ]; - $packageManager = $this->getAccessibleMock(PackageManager::class, ['resolvePackageDependencies'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['resolvePackageDependencies'], [new DependencyOrderingService()]); $packageManager->_set('packageStatesConfiguration', $packageStatesConfiguration); $packageManager->_set('composerNameToPackageKeyMap', $composerNameToPackageKeyMap); @@ -653,7 +653,7 @@ class PackageManagerTest extends UnitTestCase */ public function buildDependencyGraphBuildsCorrectGraph(array $unsortedPackageStatesConfiguration, array $frameworkPackageKeys, array $expectedGraph): void { - $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService()]); $packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys); $dependencyGraph = $packageManager->_call('buildDependencyGraph', $unsortedPackageStatesConfiguration); @@ -782,7 +782,7 @@ class PackageManagerTest extends UnitTestCase */ public function sortPackageStatesConfigurationByDependencyMakesSureThatDependantPackagesAreStandingBeforeAPackageInTheInternalPackagesAndPackagesConfigurationArrays($unsortedPackageStatesConfiguration, $frameworkPackageKeys, $expectedSortedPackageKeys): void { - $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService()]); $packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn($frameworkPackageKeys); $sortedPackageKeys = $packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration); @@ -807,7 +807,7 @@ class PackageManagerTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1381960494); - $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService]); + $packageManager = $this->getAccessibleMock(PackageManager::class, ['findFrameworkPackages'], [new DependencyOrderingService()]); $packageManager->expects(self::any())->method('findFrameworkPackages')->willReturn([]); $packageManager->_call('sortPackageStatesConfigurationByDependency', $unsortedPackageStatesConfiguration); diff --git a/typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php b/typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php index 8a2c1a31f6f8002cef76cbc217027daec885ef0e..980574e4dd5722aefbe5a7c79add1f6a2d195589 100644 --- a/typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php +++ b/typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php @@ -2855,7 +2855,7 @@ class ArrayUtilityTest extends UnitTestCase 'integer' => 1, 'float' => 1.9, 'object' => $testObject, - 'objectWithStringConversion' => new class { + 'objectWithStringConversion' => new class() { /** * @return string */ diff --git a/typo3/sysext/core/Tests/UnitDeprecated/Compatibility/PublicPropertyDeprecationTraitTest.php b/typo3/sysext/core/Tests/UnitDeprecated/Compatibility/PublicPropertyDeprecationTraitTest.php index 493b2d7439774d61ffa492d82b181825e1ed705b..4b535474381afda9a3a76e91581ef7d5473734ac 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/Compatibility/PublicPropertyDeprecationTraitTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/Compatibility/PublicPropertyDeprecationTraitTest.php @@ -40,7 +40,7 @@ class PublicPropertyDeprecationTraitTest extends UnitTestCase protected function setUp(): void { parent::setUp(); - $this->fixture = new class { + $this->fixture = new class() { use PublicPropertyDeprecationTrait; private $deprecatedPublicProperties = [ 'taggedProperty' => 'taggedProperty is deprecated', diff --git a/typo3/sysext/core/Tests/UnitDeprecated/Localization/LocalizationFactoryTest.php b/typo3/sysext/core/Tests/UnitDeprecated/Localization/LocalizationFactoryTest.php index 423e5e0e72bbe06bb16c96dc0fdb895258e8146c..bd467937ba4c5075a767975e18612e5f04947b33 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/Localization/LocalizationFactoryTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/Localization/LocalizationFactoryTest.php @@ -51,7 +51,7 @@ class LocalizationFactoryTest extends UnitTestCase $cacheFrontendProphecy->get(Argument::cetera())->willReturn(false); $cacheFrontendProphecy->set(Argument::cetera())->willReturn(null); - $subject = new LocalizationFactory; + $subject = new LocalizationFactory(); $unique = 'locallangXMLOverrideTest' . substr(StringUtility::getUniqueId(), 0, 10); $xml = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?> diff --git a/typo3/sysext/core/Tests/UnitDeprecated/Localization/Parser/LocallangXmlParserTest.php b/typo3/sysext/core/Tests/UnitDeprecated/Localization/Parser/LocallangXmlParserTest.php index f89c2ddbcdd051082c3ee74f266928c5ba615305..ba188a7007fc5a3f25382b1efe4372c0e5c668da 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/Localization/Parser/LocallangXmlParserTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/Localization/Parser/LocallangXmlParserTest.php @@ -70,7 +70,7 @@ class LocallangXmlParserTest extends UnitTestCase */ public function canParseLlxmlInEnglish() { - $LOCAL_LANG = (new LocallangXmlParser)->getParsedData(self::getFixtureFilePath('locallang.xml'), 'default'); + $LOCAL_LANG = (new LocallangXmlParser())->getParsedData(self::getFixtureFilePath('locallang.xml'), 'default'); self::assertArrayHasKey('default', $LOCAL_LANG, 'default key not found in $LOCAL_LANG'); $expectedLabels = [ 'label1' => 'This is label #1', @@ -87,7 +87,7 @@ class LocallangXmlParserTest extends UnitTestCase */ public function canParseLlxmlInMd5Code() { - $LOCAL_LANG = (new LocallangXmlParser)->getParsedData(self::getFixtureFilePath('locallang.xml'), 'md5'); + $LOCAL_LANG = (new LocallangXmlParser())->getParsedData(self::getFixtureFilePath('locallang.xml'), 'md5'); self::assertArrayHasKey('md5', $LOCAL_LANG, 'md5 key not found in $LOCAL_LANG'); $expectedLabels = [ 'label1' => '409a6edbc70dbeeccbfe5f1e569d6717', @@ -104,7 +104,7 @@ class LocallangXmlParserTest extends UnitTestCase */ public function canParseLlxmlInFrenchAndReturnsNullLabelsIfNoTranslationIsFound() { - $localLang = (new LocallangXmlParser)->getParsedData( + $localLang = (new LocallangXmlParser())->getParsedData( self::getFixtureFilePath('locallangOnlyDefaultLanguage.xml'), 'fr' ); @@ -122,7 +122,7 @@ class LocallangXmlParserTest extends UnitTestCase public function canOverrideLlxml() { /** @var $factory LocalizationFactory */ - $factory = new LocalizationFactory; + $factory = new LocalizationFactory(); $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][self::getFixtureFilePath('locallang.xml')][] = self::getFixtureFilePath('locallang_override.xml'); $LOCAL_LANG = array_merge( @@ -183,7 +183,7 @@ class LocallangXmlParserTest extends UnitTestCase public function canTranslateNumericKeys($key, $expectedResult) { /** @var $factory LocalizationFactory */ - $factory = new LocalizationFactory; + $factory = new LocalizationFactory(); $LOCAL_LANG = $factory->getParsedData(self::getFixtureFilePath('locallangNumericKeys.xml'), 'fr'); diff --git a/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php b/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php index 153912fc92e32b5afb187314e02d5c4fb0283b95..cef49fc74514d70c2430af2ac67f677e490ffdd6 100644 --- a/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php +++ b/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php @@ -351,7 +351,7 @@ class PropertyMappingConfiguration implements PropertyMappingConfigurationInterf if (isset($this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER])) { $this->subConfigurationForProperty[$currentProperty] = clone $this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER]; } else { - $this->subConfigurationForProperty[$currentProperty] = new $type; + $this->subConfigurationForProperty[$currentProperty] = new $type(); } } return $this->subConfigurationForProperty[$currentProperty]->traverseProperties($splittedPropertyPath); diff --git a/typo3/sysext/extbase/Classes/Service/CacheService.php b/typo3/sysext/extbase/Classes/Service/CacheService.php index 3644128ac286a6e344eb0ec39609776fc2ef71ca..2b9ff819c3bbeb856ecd829c6a9ec293b25eed0e 100644 --- a/typo3/sysext/extbase/Classes/Service/CacheService.php +++ b/typo3/sysext/extbase/Classes/Service/CacheService.php @@ -46,7 +46,7 @@ class CacheService implements \TYPO3\CMS\Core\SingletonInterface */ public function __construct() { - $this->pageIdStack = new \SplStack; + $this->pageIdStack = new \SplStack(); } /** diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/ConjunctionValidator.php b/typo3/sysext/extbase/Classes/Validation/Validator/ConjunctionValidator.php index ac9c657ccb0e40d9c7441e8faf7e216838cba77c..a71c05344e72122dbfa5cc756ad069b6429a4eb6 100644 --- a/typo3/sysext/extbase/Classes/Validation/Validator/ConjunctionValidator.php +++ b/typo3/sysext/extbase/Classes/Validation/Validator/ConjunctionValidator.php @@ -44,7 +44,7 @@ class ConjunctionValidator extends AbstractCompositeValidator } } } else { - $result = new Result; + $result = new Result(); } return $result; diff --git a/typo3/sysext/extbase/Configuration/Services.php b/typo3/sysext/extbase/Configuration/Services.php index 4269670dbb05dd6e9cc91b2ce69f625ee70fe41e..32f4f6503d3e713ed42b28034760d0298553f22f 100644 --- a/typo3/sysext/extbase/Configuration/Services.php +++ b/typo3/sysext/extbase/Configuration/Services.php @@ -14,7 +14,7 @@ return function (ContainerConfigurator $containerConfigurator, ContainerBuilder $container->registerForAutoconfiguration(Mvc\Controller\ActionController::class)->addTag('extbase.action_controller'); $container->registerForAutoconfiguration(Mvc\View\ViewInterface::class)->addTag('extbase.view'); - $container->addCompilerPass(new class implements CompilerPassInterface { + $container->addCompilerPass(new class() implements CompilerPassInterface { public function process(ContainerBuilder $container): void { foreach ($container->findTaggedServiceIds('extbase.request_handler') as $id => $tags) { diff --git a/typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperTest.php b/typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperTest.php index a36b9ae4e35749c8d84aa2d82618b7ac5530dff0..54f19ccdeb1be9a5ccfc0003b3fa7943449c795b 100644 --- a/typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperTest.php @@ -42,7 +42,7 @@ class PropertyMapperTest extends FunctionalTestCase { static::expectExceptionCode(1297951378); - $class = new class extends ArrayConverter { + $class = new class() extends ArrayConverter { }; ExtensionUtility::registerTypeConverter(get_class($class)); GeneralUtility::getContainer()->get(PropertyMapper::class); @@ -138,7 +138,7 @@ class PropertyMapperTest extends FunctionalTestCase static::expectExceptionCode(1297759968); static::expectExceptionMessage('There exist at least two converters which handle the conversion to an interface with priority "10"'); - $converterOne = new class extends AbstractTypeConverter { + $converterOne = new class() extends AbstractTypeConverter { protected $priority = 10; protected $sourceTypes = ['integer']; protected $targetType = \Countable::class; @@ -149,7 +149,7 @@ class PropertyMapperTest extends FunctionalTestCase } }; - $converterTwo = new class extends AbstractTypeConverter { + $converterTwo = new class() extends AbstractTypeConverter { protected $priority = 10; protected $sourceTypes = ['integer']; protected $targetType = ExtendedCountableInterface::class; @@ -160,7 +160,7 @@ class PropertyMapperTest extends FunctionalTestCase } }; - $counter = new class implements ExtendedCountableInterface { + $counter = new class() implements ExtendedCountableInterface { public function count() { return 1; @@ -194,7 +194,7 @@ class PropertyMapperTest extends FunctionalTestCase */ public function findTypeConverterReturnsTheConverterFromThePropertyMappingConfiguration() { - $class = new class extends IntegerConverter { + $class = new class() extends IntegerConverter { public function convertFrom($source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null) { return 1575648246; @@ -250,7 +250,7 @@ class PropertyMapperTest extends FunctionalTestCase */ public function findFirstEligibleTypeConverterInObjectHierarchyFindsConverterFromStringToObject() { - $converter = new class extends AbstractTypeConverter { + $converter = new class() extends AbstractTypeConverter { protected $priority = 10; protected $sourceTypes = ['string']; protected $targetType = Cat::class; @@ -272,7 +272,7 @@ class PropertyMapperTest extends FunctionalTestCase */ public function findFirstEligibleTypeConverterInObjectHierarchyReturnsConverterForParentClass() { - $converter = new class extends AbstractTypeConverter { + $converter = new class() extends AbstractTypeConverter { protected $priority = 10; protected $sourceTypes = ['string']; protected $targetType = Animal::class; @@ -294,7 +294,7 @@ class PropertyMapperTest extends FunctionalTestCase */ public function findFirstEligibleTypeConverterInObjectHierarchyReturnsConverterForInterfaces() { - $converter = new class extends AbstractTypeConverter { + $converter = new class() extends AbstractTypeConverter { protected $priority = 10; protected $sourceTypes = ['integer']; protected $targetType = \Countable::class; @@ -305,7 +305,7 @@ class PropertyMapperTest extends FunctionalTestCase } }; - $counter = new class implements \Countable { + $counter = new class() implements \Countable { public function count() { return 1; diff --git a/typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php b/typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php index 5259ce39ce1123c6ff53dcf0db4f0bfcbfb87081..c135f08425a55483b87aec62c7e47c70c9a83db6 100644 --- a/typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php @@ -36,7 +36,7 @@ class ObjectConverterTest extends FunctionalTestCase { $propertyMapper = GeneralUtility::getContainer()->get(PropertyMapper::class); - $model = new class extends AbstractEntity { + $model = new class() extends AbstractEntity { /** * @var string */ @@ -86,7 +86,7 @@ class ObjectConverterTest extends FunctionalTestCase */ public function getTypeOfChildPropertyReturnsTypeDefinedByPropertyMappingConfiguration() { - $class = new class { + $class = new class() { public $name; }; @@ -146,7 +146,7 @@ class ObjectConverterTest extends FunctionalTestCase */ public function getTypeOfChildPropertyReturnsTypeDefinedBySetter() { - $class = new class { + $class = new class() { private $name; public function setName(string $name) { @@ -176,7 +176,7 @@ class ObjectConverterTest extends FunctionalTestCase */ public function getTypeOfChildPropertyThrowsInvalidTargetExceptionIfPropertyIsNotAccessible() { - $class = new class { + $class = new class() { }; $className = get_class($class); @@ -202,7 +202,7 @@ class ObjectConverterTest extends FunctionalTestCase */ public function getTypeOfChildPropertyThrowsInvalidTargetExceptionIfPropertyTypeCannotBeDerivedFromNonExistingConstructorArgument() { - $class = new class { + $class = new class() { public function __construct() { } @@ -231,7 +231,7 @@ class ObjectConverterTest extends FunctionalTestCase */ public function getTypeOfChildPropertyThrowsInvalidTargetExceptionIfPropertyTypeCannotBeDerivedFromExistingConstructorArgument() { - $class = new class { + $class = new class() { public function __construct($name = null) { } @@ -264,7 +264,7 @@ class ObjectConverterTest extends FunctionalTestCase static::expectExceptionCode(1297759968); static::expectExceptionMessage('Exception while property mapping at property path "": Setter for property "name" had no type hint or documentation in target object of type "'); - $class = new class { + $class = new class() { public function setName($name) { } @@ -290,7 +290,7 @@ class ObjectConverterTest extends FunctionalTestCase static::expectExceptionCode(1297759968); static::expectExceptionMessage('Exception while property mapping at property path "": Property "name" having a value of type "string" could not be set in target object of type "'); - $class = new class { + $class = new class() { private $name; }; @@ -371,7 +371,7 @@ class ObjectConverterTest extends FunctionalTestCase static::expectExceptionCode(1297759968); static::expectExceptionMessage('Exception while property mapping at property path "": Override of target type not allowed. To enable this, you need to set the PropertyMappingConfiguration Value "CONFIGURATION_OVERRIDE_TARGET_TYPE_ALLOWED" to TRUE.'); - $class = new class { + $class = new class() { }; GeneralUtility::getContainer()->get(PropertyMapper::class)->convert( @@ -389,7 +389,7 @@ class ObjectConverterTest extends FunctionalTestCase static::expectExceptionCode(1297759968); static::expectExceptionMessage('Exception while property mapping at property path "": The given type "TYPO3\CMS\Extbase\Tests\Functional\Property\Fixtures\Animal" is not a subtype of "'); - $class = new class { + $class = new class() { }; $propertyMapperConfiguration = new PropertyMappingConfiguration(); diff --git a/typo3/sysext/extbase/Tests/Unit/DomainObject/AbstractEntityTest.php b/typo3/sysext/extbase/Tests/Unit/DomainObject/AbstractEntityTest.php index c4ee26ad9136cbe300152635b90abad03c08895d..5583d288940399765de2643ea0a9f1c9995faef8 100644 --- a/typo3/sysext/extbase/Tests/Unit/DomainObject/AbstractEntityTest.php +++ b/typo3/sysext/extbase/Tests/Unit/DomainObject/AbstractEntityTest.php @@ -29,7 +29,7 @@ class AbstractEntityTest extends UnitTestCase */ public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithSimpleProperties() { - $domainObject = new class extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + $domainObject = new class() extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { public $foo = 'Test'; public $bar = 'It is raining outside'; }; @@ -43,7 +43,7 @@ class AbstractEntityTest extends UnitTestCase */ public function objectIsDirtyAfterCallingMemorizeCleanStateWithSimplePropertiesAndModifyingThePropertiesAfterwards() { - $domainObject = new class extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + $domainObject = new class() extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { public $foo = 'Test'; public $bar = 'It is raining outside'; }; @@ -58,7 +58,7 @@ class AbstractEntityTest extends UnitTestCase */ public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithObjectProperties() { - $domainObject = new class extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + $domainObject = new class() extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { public $foo; public $bar = 'It is raining outside'; }; @@ -73,12 +73,12 @@ class AbstractEntityTest extends UnitTestCase */ public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithOtherDomainObjectsAsProperties() { - $domainObject = new class extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + $domainObject = new class() extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { public $foo; public $bar; }; - $secondDomainObject = new class extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + $secondDomainObject = new class() extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { public $foo; public $bar; }; diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php index 1a4c1ce12fd476c5fec21131048a2669e30e788d..529f664f19b5a229ce5805e397a2b125c4bd5638 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php @@ -182,7 +182,7 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase $request->expects(self::any())->method('getInternalArgument')->with('__trustedProperties')->willReturn(null); $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); - $requestHashService = new MvcPropertyMappingConfigurationService; + $requestHashService = new MvcPropertyMappingConfigurationService(); $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments); } @@ -199,7 +199,7 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); $hashService = new \TYPO3\CMS\Extbase\Security\Cryptography\HashService(); - $requestHashService = new MvcPropertyMappingConfigurationService; + $requestHashService = new MvcPropertyMappingConfigurationService(); $requestHashService->injectHashService($hashService); $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments); } diff --git a/typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php b/typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php index 08797d7bafdb329845d9f8b6d20bf14ec05d3efb..f3ae3664e4c4ef5bebd470a989bafef444928140 100644 --- a/typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php @@ -53,9 +53,9 @@ class ContainerTest extends UnitTestCase ->setMethods(['notice']) ->disableOriginalConstructor() ->getMock(); - $reflectionService = new \TYPO3\CMS\Extbase\Reflection\ReflectionService; + $reflectionService = new \TYPO3\CMS\Extbase\Reflection\ReflectionService(); - $notFoundException = new class extends \Exception implements \Psr\Container\NotFoundExceptionInterface { + $notFoundException = new class() extends \Exception implements \Psr\Container\NotFoundExceptionInterface { }; $psrContainer = $this->getMockBuilder(\Psr\Container\ContainerInterface::class) diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php index 83871da1e101bba729f0f77df574feadacf327ca..51ac281ebca3dd17357f3fc4fc8c4cf62ae03160 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php @@ -281,9 +281,9 @@ class ObjectStorageTest extends UnitTestCase public function allRelationsAreNotDirtyOnAttachingAndRemoving() { $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); - $object1 = new \stdClass; - $object2 = new \stdClass; - $object3 = new \stdClass; + $object1 = new \stdClass(); + $object2 = new \stdClass(); + $object3 = new \stdClass(); $objectStorage->attach($object1); $objectStorage->attach($object2); $objectStorage->detach($object2); @@ -298,8 +298,8 @@ class ObjectStorageTest extends UnitTestCase public function theRelationsAreNotDirtyOnReAddingAtSamePosition() { $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); - $object1 = new \stdClass; - $object2 = new \stdClass; + $object1 = new \stdClass(); + $object2 = new \stdClass(); $objectStorage->attach($object1); $objectStorage->attach($object2); $clonedStorage = clone $objectStorage; @@ -316,8 +316,8 @@ class ObjectStorageTest extends UnitTestCase public function theRelationsAreDirtyOnReAddingAtOtherPosition() { $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); - $object1 = new \stdClass; - $object2 = new \stdClass; + $object1 = new \stdClass(); + $object2 = new \stdClass(); $objectStorage->attach($object1); $objectStorage->attach($object2); $clonedStorage = clone $objectStorage; diff --git a/typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php b/typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php index b6afd991574e1da27ee98f3b35597bc90beb4148..0f7805cf5755ee7161bc41117fc108fa91cad81d 100644 --- a/typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php @@ -251,7 +251,7 @@ class ClassSchemaTest extends UnitTestCase */ public function classSchemaDetectsMethodParameterTypeViaReflection(): void { - $class = new class { + $class = new class() { public function foo(string $foo) { } @@ -271,7 +271,7 @@ class ClassSchemaTest extends UnitTestCase */ public function classSchemaPrefersMethodParameterTypeDetectionViaReflection(): void { - $class = new class { + $class = new class() { /** * @param ClassSchema $foo */ diff --git a/typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/Validation/Validator/DummyValidator.php b/typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/Validation/Validator/DummyValidator.php index 78c728836fefaf39d2839aaf93e812cca98ad6b1..569289fb32ada2bf6f4275e455271e92e1cec593 100644 --- a/typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/Validation/Validator/DummyValidator.php +++ b/typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/Validation/Validator/DummyValidator.php @@ -30,7 +30,7 @@ class DummyValidator implements ValidatorInterface */ public function validate($value) { - return new \TYPO3\CMS\Extbase\Error\Result; + return new \TYPO3\CMS\Extbase\Error\Result(); } /** diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/DateTimeValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/DateTimeValidatorTest.php index 9f522a5a09726b32b826122ffe51d06d0d727438..1eb1f4e4ca53c396f684c02b4a7c669a8210a040 100644 --- a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/DateTimeValidatorTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/DateTimeValidatorTest.php @@ -47,14 +47,14 @@ class DateTimeValidatorTest extends UnitTestCase new \DateTime(), ], 'Extended ' . \DateTime::class => [ - new class extends \DateTime { + new class() extends \DateTime { }, ], \DateTimeImmutable::class => [ new \DateTimeImmutable(), ], 'Extended ' . \DateTimeImmutable::class => [ - new class extends \DateTimeImmutable { + new class() extends \DateTimeImmutable { }, ], ]; diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/UrlValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/UrlValidatorTest.php index dbee36b01cc9fd568775ec8c6e392042a2238cd1..815468c38fb92b8e44bbf1f84b033a64aae82ec4 100644 --- a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/UrlValidatorTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/UrlValidatorTest.php @@ -109,7 +109,7 @@ class UrlValidatorTest extends UnitTestCase 'isValid' => false, ], 'Invalid value is object' => [ - 'value' => new \stdClass, + 'value' => new \stdClass(), 'isValid' => false, ], 'Invalid value is closure' => [ diff --git a/typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php b/typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php index 22b789ae579196e6e3c30c9b194de07b2bc53df4..57232b96648efe080263e242cd041519ee9faac6 100644 --- a/typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php +++ b/typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php @@ -85,7 +85,7 @@ class ExtensionTest extends UnitTestCase */ public function getCategoryIndexFromStringOrNumberReturnsIndex($input, $expected) { - $extension = new \TYPO3\CMS\Extensionmanager\Domain\Model\Extension; + $extension = new \TYPO3\CMS\Extensionmanager\Domain\Model\Extension(); self::assertEquals($expected, $extension->getCategoryIndexFromStringOrNumber($input)); } } diff --git a/typo3/sysext/felogin/Tests/Unit/Service/ValidatorResolverServiceTest.php b/typo3/sysext/felogin/Tests/Unit/Service/ValidatorResolverServiceTest.php index 848321e1599574314d1bb194137ee1ac621aa4bf..e3026d56b47d81dab57189eadd6ac755124faf31 100644 --- a/typo3/sysext/felogin/Tests/Unit/Service/ValidatorResolverServiceTest.php +++ b/typo3/sysext/felogin/Tests/Unit/Service/ValidatorResolverServiceTest.php @@ -73,7 +73,7 @@ class ValidatorResolverServiceTest extends UnitTestCase protected function setUp(): void { - $this->subject = new ValidatorResolverService; + $this->subject = new ValidatorResolverService(); parent::setUp(); } diff --git a/typo3/sysext/fluid/Configuration/Services.php b/typo3/sysext/fluid/Configuration/Services.php index 68b0892c2628b0eb97513688b035a8558e5543bf..d01edf8898a74bf932cf7d51aeccc7f15c2ec414 100644 --- a/typo3/sysext/fluid/Configuration/Services.php +++ b/typo3/sysext/fluid/Configuration/Services.php @@ -11,7 +11,7 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface; return function (ContainerConfigurator $container, ContainerBuilder $containerBuilder) { $containerBuilder->registerForAutoconfiguration(ViewHelperInterface::class)->addTag('fluid.viewhelper'); - $containerBuilder->addCompilerPass(new class implements CompilerPassInterface { + $containerBuilder->addCompilerPass(new class() implements CompilerPassInterface { public function process(ContainerBuilder $container) { foreach ($container->findTaggedServiceIds('fluid.viewhelper') as $id => $tags) { diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php index c70a19eb48d38518a08bc447bc256ac3b2304c31..53de5e280ae9cde6251ebd0801b4d4e65449eefe 100644 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php +++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php @@ -200,7 +200,7 @@ class PaginateControllerTest extends UnitTestCase { $objects = new ObjectStorage(); for ($i = 0; $i <= 25; $i++) { - $item = new \stdClass; + $item = new \stdClass(); $objects->attach($item); } $this->controller->_set('objects', $objects); @@ -219,7 +219,7 @@ class PaginateControllerTest extends UnitTestCase $this->controller->_set('currentPage', 2); $objects = new ObjectStorage(); for ($i = 0; $i <= 55; $i++) { - $item = new \stdClass; + $item = new \stdClass(); $objects->attach($item); } $this->controller->_set('objects', $objects); @@ -238,7 +238,7 @@ class PaginateControllerTest extends UnitTestCase $this->controller->_set('currentPage', 3); $objects = new ObjectStorage(); for ($i = 0; $i <= 25; $i++) { - $item = new \stdClass; + $item = new \stdClass(); $objects->attach($item); } $this->controller->_set('objects', $objects); @@ -256,7 +256,7 @@ class PaginateControllerTest extends UnitTestCase { $objects = []; for ($i = 0; $i <= 25; $i++) { - $item = new \stdClass; + $item = new \stdClass(); $objects[] = $item; } $this->controller->_set('objects', $objects); @@ -275,7 +275,7 @@ class PaginateControllerTest extends UnitTestCase $this->controller->_set('currentPage', 2); $objects = []; for ($i = 0; $i <= 55; $i++) { - $item = new \stdClass; + $item = new \stdClass(); $objects[] = $item; } $this->controller->_set('objects', $objects); diff --git a/typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php b/typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php index ef803056535a2cc609b75fb37c7a97576a8c3327..28fd78f7d1f08812f28236d8d3eb805018edd90d 100644 --- a/typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php +++ b/typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php @@ -75,7 +75,7 @@ class FormFrontendControllerTest extends UnitTestCase ]) ); - $flexFormTools = new FlexFormTools; + $flexFormTools = new FlexFormTools(); $contentObject = new ContentObjectRenderer(); $contentObject->data = [ 'pi_flexform' => $flexFormTools->flexArray2Xml([ @@ -209,7 +209,7 @@ class FormFrontendControllerTest extends UnitTestCase ]) ); - $flexFormTools = new FlexFormTools; + $flexFormTools = new FlexFormTools(); $contentObject = new ContentObjectRenderer(); $contentObject->data = [ 'pi_flexform' => $flexFormTools->flexArray2Xml([ @@ -359,7 +359,7 @@ class FormFrontendControllerTest extends UnitTestCase ]) ); - $flexFormTools = new FlexFormTools; + $flexFormTools = new FlexFormTools(); $contentObject = new ContentObjectRenderer(); $contentObject->data = [ 'pi_flexform' => $flexFormTools->flexArray2Xml([ diff --git a/typo3/sysext/form/Tests/Unit/Domain/Configuration/FormDefinitionConversionServiceTest.php b/typo3/sysext/form/Tests/Unit/Domain/Configuration/FormDefinitionConversionServiceTest.php index d6d6007ed3a48b1816d18a5ef4adf2d7503b7bb4..27b644398d1c643bf3a014acb07251abd61756e9 100644 --- a/typo3/sysext/form/Tests/Unit/Domain/Configuration/FormDefinitionConversionServiceTest.php +++ b/typo3/sysext/form/Tests/Unit/Domain/Configuration/FormDefinitionConversionServiceTest.php @@ -130,7 +130,7 @@ class FormDefinitionConversionServiceTest extends UnitTestCase */ public function removeHmacDataRemoveHmacs() { - $formDefinitionConversionService = new FormDefinitionConversionService; + $formDefinitionConversionService = new FormDefinitionConversionService(); GeneralUtility::setSingletonInstance(FormDefinitionConversionService::class, $formDefinitionConversionService); $input = [ diff --git a/typo3/sysext/form/Tests/Unit/Domain/Finishers/AbstractFinisherTest.php b/typo3/sysext/form/Tests/Unit/Domain/Finishers/AbstractFinisherTest.php index dc74c6ccb0d1e28125e0223e0207eea99e35d678..abbd4536a33a1bafe0b82fda6b6bfdfcd49ccb0b 100644 --- a/typo3/sysext/form/Tests/Unit/Domain/Finishers/AbstractFinisherTest.php +++ b/typo3/sysext/form/Tests/Unit/Domain/Finishers/AbstractFinisherTest.php @@ -141,7 +141,7 @@ class AbstractFinisherTest extends UnitTestCase $finisherContextProphecy->getFormRuntime(Argument::cetera()) ->willReturn($formRuntimeProphecy->reveal()); $finisherContextProphecy->getFinisherVariableProvider(Argument::cetera()) - ->willReturn(new FinisherVariableProvider); + ->willReturn(new FinisherVariableProvider()); $mockAbstractFinisher->_set('finisherContext', $finisherContextProphecy->reveal()); @@ -420,7 +420,7 @@ class AbstractFinisherTest extends UnitTestCase ]); $finisherContextProphecy = $this->prophesize(FinisherContext::class); - $finisherContextProphecy->getFinisherVariableProvider(Argument::cetera())->willReturn(new FinisherVariableProvider); + $finisherContextProphecy->getFinisherVariableProvider(Argument::cetera())->willReturn(new FinisherVariableProvider()); $mockAbstractFinisher->_set('finisherContext', $finisherContextProphecy->reveal()); self::assertSame($expected, $mockAbstractFinisher->_call('substituteRuntimeReferences', $input, $formRuntimeProphecy->reveal())); @@ -494,7 +494,7 @@ class AbstractFinisherTest extends UnitTestCase 'date-1' => $date, ]); - $stringableElement = new class implements StringableFormElementInterface { + $stringableElement = new class() implements StringableFormElementInterface { /** * @param \DateTimeInterface $value */ @@ -572,7 +572,7 @@ class AbstractFinisherTest extends UnitTestCase ]); $finisherContextProphecy = $this->prophesize(FinisherContext::class); - $finisherContextProphecy->getFinisherVariableProvider(Argument::cetera())->willReturn(new FinisherVariableProvider); + $finisherContextProphecy->getFinisherVariableProvider(Argument::cetera())->willReturn(new FinisherVariableProvider()); $mockAbstractFinisher->_set('finisherContext', $finisherContextProphecy->reveal()); $this->expectException(FinisherException::class); diff --git a/typo3/sysext/form/Tests/Unit/Domain/Finishers/SaveToDatabaseFinisherTest.php b/typo3/sysext/form/Tests/Unit/Domain/Finishers/SaveToDatabaseFinisherTest.php index ff18c6988b703c551d9ae54f5a39ccd8be6f47d1..7ea7e7624be38a65fdace02afa838e6183907711 100644 --- a/typo3/sysext/form/Tests/Unit/Domain/Finishers/SaveToDatabaseFinisherTest.php +++ b/typo3/sysext/form/Tests/Unit/Domain/Finishers/SaveToDatabaseFinisherTest.php @@ -190,7 +190,7 @@ class SaveToDatabaseFinisherTest extends UnitTestCase $saveToDatabaseFinisher = $this->getAccessibleMock(SaveToDatabaseFinisher::class, ['getFormValues', 'getElementByIdentifier']); $saveToDatabaseFinisher->method('getFormValues')->willReturn([ - 'date' => new \DateTime, + 'date' => new \DateTime(), ]); $saveToDatabaseFinisher->method('getElementByIdentifier')->willReturn($this->prophesize(FormElementInterface::class)->reveal()); $databaseData = $saveToDatabaseFinisher->_call('prepareData', $elementsConfiguration, []); diff --git a/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php b/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php index e4fd78624207213966c61b1e1015dee18355693c..861c0cae5526ab2ccaafa09092cbcc808c2ae6fc 100644 --- a/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php +++ b/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php @@ -129,7 +129,7 @@ class FormRuntimeTest extends UnitTestCase $objectManagerProphecy ->get('fooRenderer') - ->willReturn(new \stdClass); + ->willReturn(new \stdClass()); $mockFormRuntime->_set('formState', $mockFormState); $mockFormRuntime->_set('currentPage', $mockPage); diff --git a/typo3/sysext/form/Tests/Unit/Mvc/Configuration/TypoScriptServiceTest.php b/typo3/sysext/form/Tests/Unit/Mvc/Configuration/TypoScriptServiceTest.php index a8f4f35e422cab154ae909958ee3e8b6cc7a75c8..8c2c812bbcc8846c3087e9e681a149a544ada9d5 100644 --- a/typo3/sysext/form/Tests/Unit/Mvc/Configuration/TypoScriptServiceTest.php +++ b/typo3/sysext/form/Tests/Unit/Mvc/Configuration/TypoScriptServiceTest.php @@ -37,7 +37,7 @@ class TypoScriptServiceTest extends UnitTestCase ContentObjectRenderer::class )->getMock(); - $fakeTypoScriptFrontendController = new \stdClass; + $fakeTypoScriptFrontendController = new \stdClass(); $fakeTypoScriptFrontendController->cObj = $mockContentObjectRenderer; $mockContentObjectRenderer diff --git a/typo3/sysext/frontend/Classes/Controller/ShowImageController.php b/typo3/sysext/frontend/Classes/Controller/ShowImageController.php index 18b6853967f3aae04ed17886e92160e771eb0a94..647a8970ac56a9f960f9c626b4f277b697529681 100644 --- a/typo3/sysext/frontend/Classes/Controller/ShowImageController.php +++ b/typo3/sysext/frontend/Classes/Controller/ShowImageController.php @@ -204,9 +204,9 @@ EOF; return $response; } catch (\InvalidArgumentException $e) { // add a 410 "gone" if invalid parameters given - return (new Response)->withStatus(410); + return (new Response())->withStatus(410); } catch (Exception $e) { - return (new Response)->withStatus(404); + return (new Response())->withStatus(404); } } } diff --git a/typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php b/typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php index cdc340eb9f939616cb7eb96d6178502321958ff8..b2a12c81aebe4f9c19eec7fddd7f6661fa772f0a 100644 --- a/typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php +++ b/typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php @@ -66,7 +66,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\TestingFramework\Core\Functi ]; $expectedResult = 'ABC'; - $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; + $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer(); $contentObjectRenderer->setContentObjectClassMap([ 'FLUIDTEMPLATE' => FluidTemplateContentObject::class, 'TEXT' => TextContentObject::class, @@ -114,7 +114,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\TestingFramework\Core\Functi ]; $expectedResult = 'DefaultLayoutLayoutOverride'; - $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; + $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer(); $contentObjectRenderer->setContentObjectClassMap([ 'FLUIDTEMPLATE' => FluidTemplateContentObject::class, 'TEXT' => TextContentObject::class, diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php index f515640972776e68885c6a2af22de187cee93c15..b78fab81b344ea50b3fcfd119f5e48bfb08adef0 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php @@ -1717,7 +1717,7 @@ class ContentObjectRendererTest extends UnitTestCase */ public function getDataWithTypeSiteWithBaseVariants(): void { - $packageManager = new PackageManager(new DependencyOrderingService); + $packageManager = new PackageManager(new DependencyOrderingService()); GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager); $cacheManagerProphecy = $this->prophesize(CacheManager::class); $cacheManagerProphecy->getCache('core')->willReturn(new NullFrontend('core')); diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php index fd04c98b51c1c45b5c95492b12afdf70c941788b..c6b63e4823e5b1db28080997f85d3e0a624efb69 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php @@ -32,7 +32,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase { $this->expectException(NoSuchMenuTypeException::class); $this->expectExceptionCode(1363278130); - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); $factory->getMenuObjectByType(StringUtility::getUniqueId('foo_')); } @@ -41,7 +41,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase */ public function getMenuObjectByTypeReturnsObjectForRegisteredMenuType() { - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); self::assertIsObject($factory->getMenuObjectByType('TMENU')); } @@ -50,7 +50,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase */ public function getMenuObjectByTypeReturnsObjectWithLowercasedMenuType() { - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); self::assertIsObject($factory->getMenuObjectByType('tmenu')); } @@ -59,7 +59,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase */ public function getMenuObjectByTypeReturnsInstanceOfOwnRegisteredTypeInsteadOfInternalType() { - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); $selfClassName = static::class; $factory->registerMenuType('TMENU', $selfClassName); self::assertInstanceOf($selfClassName, $factory->getMenuObjectByType('TMENU')); @@ -70,7 +70,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase */ public function getMenuObjectByTypeReturnsInstanceOfNewRegisteredType() { - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); $selfClassName = static::class; $uniqueMenuType = StringUtility::getUniqueId('foo_'); $factory->registerMenuType($uniqueMenuType, $selfClassName); @@ -84,7 +84,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionCode(1363429303); - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); $factory->registerMenuType([], 'foo'); } @@ -95,7 +95,7 @@ class MenuContentObjectFactoryTest extends UnitTestCase { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionCode(1363429303); - $factory = new MenuContentObjectFactory; + $factory = new MenuContentObjectFactory(); $factory->registerMenuType('foo', []); } } diff --git a/typo3/sysext/frontend/Tests/Unit/Middleware/PageArgumentValidatorTest.php b/typo3/sysext/frontend/Tests/Unit/Middleware/PageArgumentValidatorTest.php index 71fc2f7f4ff0971f47796327483be0ea8a4a9c9a..da0925d6848f7415ecb7d89bdf5ad263f945de94 100644 --- a/typo3/sysext/frontend/Tests/Unit/Middleware/PageArgumentValidatorTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Middleware/PageArgumentValidatorTest.php @@ -62,7 +62,7 @@ class PageArgumentValidatorTest extends UnitTestCase $this->cacheHashCalculator = new CacheHashCalculator(); // A request handler which only runs through - $this->responseOutputHandler = new class implements RequestHandlerInterface { + $this->responseOutputHandler = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new Response(); diff --git a/typo3/sysext/frontend/Tests/Unit/Middleware/PageResolverTest.php b/typo3/sysext/frontend/Tests/Unit/Middleware/PageResolverTest.php index 0fe68b7937070dfcab699f112af3aef23d844d03..b28beece6ba817b1c8d74476ee5fc90a9e0eb787 100644 --- a/typo3/sysext/frontend/Tests/Unit/Middleware/PageResolverTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Middleware/PageResolverTest.php @@ -65,7 +65,7 @@ class PageResolverTest extends UnitTestCase $this->controller = $this->getAccessibleMock(TypoScriptFrontendController::class, ['getSiteScript', 'determineId', 'isBackendUserLoggedIn'], [], '', false); // A request handler which expects a site with some more details are found. - $this->responseOutputHandler = new class implements RequestHandlerInterface { + $this->responseOutputHandler = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { /** @var SiteInterface $site */ diff --git a/typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php b/typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php index 0e25df35957ef8047658f6064b2a8278524c073c..50d7385f8c2de71d585804837c4e7536476f7c05 100644 --- a/typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php @@ -50,7 +50,7 @@ class SiteBaseRedirectResolverTest extends UnitTestCase { parent::setUp(); // A request handler which expects a site to be found. - $this->siteFoundRequestHandler = new class implements RequestHandlerInterface { + $this->siteFoundRequestHandler = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { /** @var Site $site */ diff --git a/typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php b/typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php index 2cde193cc200f3f9a6d9ce1180bd0dce43402961..368049de0412d8d72c366d96aa91f5cfc5f2e650 100644 --- a/typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php @@ -65,7 +65,7 @@ class SiteResolverTest extends UnitTestCase $this->siteFinder = $this->getAccessibleMock(SiteFinder::class, ['dummy'], [], '', false); // A request handler which expects a site to be found. - $this->siteFoundRequestHandler = new class implements RequestHandlerInterface { + $this->siteFoundRequestHandler = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { /** @var Site $site */ diff --git a/typo3/sysext/frontend/Tests/Unit/Middleware/StaticRouteResolverTest.php b/typo3/sysext/frontend/Tests/Unit/Middleware/StaticRouteResolverTest.php index beb3ba04616a3a7b448954c44ada6ecf325dd423..1374bdde53f104037e710c8d619f8db3452211fa 100644 --- a/typo3/sysext/frontend/Tests/Unit/Middleware/StaticRouteResolverTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Middleware/StaticRouteResolverTest.php @@ -40,7 +40,7 @@ class StaticRouteResolverTest extends UnitTestCase { parent::setUp(); // A request handler which expects a site to be found. - $this->requestHandler = new class implements RequestHandlerInterface { + $this->requestHandler = new class() implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new NullResponse(); diff --git a/typo3/sysext/install/Classes/Middleware/Maintenance.php b/typo3/sysext/install/Classes/Middleware/Maintenance.php index b07c0168221b66deabd76ed0b424dc5c32376dc5..fa74623335c282ee8c0ac310cba33023e7ff2c7f 100644 --- a/typo3/sysext/install/Classes/Middleware/Maintenance.php +++ b/typo3/sysext/install/Classes/Middleware/Maintenance.php @@ -221,7 +221,7 @@ class Maintenance implements MiddlewareInterface $this->recreatePackageStatesFileIfMissing(); $className = $this->controllers[$controllerName]; /** @var AbstractController $controller */ - $controller = $this->container->has($className) ? $this->container->get($className) : new $className; + $controller = $this->container->has($className) ? $this->container->get($className) : new $className(); if (!method_exists($controller, $action)) { throw new \RuntimeException( 'Unknown action method ' . $action . ' in controller ' . $controllerName, diff --git a/typo3/sysext/install/Classes/ServiceProvider.php b/typo3/sysext/install/Classes/ServiceProvider.php index e97ca0255348106c394862d838b76b7a707d019b..ce153a61e94645ad2c7df971a1a5006715142227 100644 --- a/typo3/sysext/install/Classes/ServiceProvider.php +++ b/typo3/sysext/install/Classes/ServiceProvider.php @@ -76,7 +76,7 @@ class ServiceProvider extends AbstractServiceProvider public static function getNotFoundRequestHandler(ContainerInterface $container): Http\NotFoundRequestHandler { - return new Http\NotFoundRequestHandler; + return new Http\NotFoundRequestHandler(); } public static function getLateBootService(ContainerInterface $container): Service\LateBootService diff --git a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php index 1839ff84d379b3806a09f96df2b7ef7a2ca782e0..4cf20444dcccd34fa74679ed3ce4186501ae8b4c 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php @@ -177,7 +177,7 @@ class DatabaseCheck implements CheckInterface { if (!empty($this->databaseDriverCheckMap[$databaseDriver])) { /** @var CheckInterface $databaseDriverCheck */ - $databaseDriverCheck = new $this->databaseDriverCheckMap[$databaseDriver]; + $databaseDriverCheck = new $this->databaseDriverCheckMap[$databaseDriver](); foreach ($databaseDriverCheck->getStatus() as $message) { $this->messageQueue->addMessage($message); } @@ -213,7 +213,7 @@ class DatabaseCheck implements CheckInterface } if (!empty(static::$databaseDriverToPlatformMapping[$databaseDriver])) { - $platformMessageQueue = (new $databasePlatformClass)->getStatus(); + $platformMessageQueue = (new $databasePlatformClass())->getStatus(); foreach ($platformMessageQueue as $message) { $this->messageQueue->enqueue($message); } diff --git a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ClassNameMatcherFixture.php b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ClassNameMatcherFixture.php index 07317999b4f6c17046e7987e04203ea22ceeca6a..266b839b32c5d84a278fd4f02d47c50865623010 100644 --- a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ClassNameMatcherFixture.php +++ b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ClassNameMatcherFixture.php @@ -33,10 +33,10 @@ class ClassNameMatcherFixture extends App2 implements App3, Con\Application { // Matches $foo = new \RemoveXSS(); - $foo = new \RemoveXSS; + $foo = new \RemoveXSS(); (new \RemoveXSS())->foo(); $foo = new \TYPO3\CMS\Backend\Console\Application(); - (new \TYPO3\CMS\Backend\Console\Application)->foo(); + (new \TYPO3\CMS\Backend\Console\Application())->foo(); Application::foo(); App1::bar(); \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(App2::class)->foo(); diff --git a/typo3/sysext/reports/Tests/Unit/Report/Status/Typo3StatusTest.php b/typo3/sysext/reports/Tests/Unit/Report/Status/Typo3StatusTest.php index 364fa56394028c6df99fd0df8f3b7742d9792d54..c2012313de2753fb1834b807b827b120bcb21dff 100644 --- a/typo3/sysext/reports/Tests/Unit/Report/Status/Typo3StatusTest.php +++ b/typo3/sysext/reports/Tests/Unit/Report/Status/Typo3StatusTest.php @@ -37,7 +37,7 @@ class Typo3StatusTest extends UnitTestCase public function getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists() { $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = []; - $fixture = new \TYPO3\CMS\Reports\Report\Status\Typo3Status; + $fixture = new \TYPO3\CMS\Reports\Report\Status\Typo3Status(); $result = $fixture->getStatus(); $statusObject = $result['registeredXclass']; self::assertSame(\TYPO3\CMS\Reports\Status::OK, $statusObject->getSeverity()); @@ -53,7 +53,7 @@ class Typo3StatusTest extends UnitTestCase 'className' => 'bar', ] ]; - $fixture = new \TYPO3\CMS\Reports\Report\Status\Typo3Status; + $fixture = new \TYPO3\CMS\Reports\Report\Status\Typo3Status(); $result = $fixture->getStatus(); $statusObject = $result['registeredXclass']; self::assertSame(\TYPO3\CMS\Reports\Status::NOTICE, $statusObject->getSeverity());