Skip to content

Commit 7997488

Browse files
style: apply Rector fixes (remove redundant parent calls, closures to arrow functions)
1 parent 1827c11 commit 7997488

6 files changed

Lines changed: 6 additions & 34 deletions

File tree

Tests/Unit/Service/Authentication/BackendUserServiceTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ final class BackendUserServiceTest extends TestCase
3131
protected function tearDown(): void
3232
{
3333
unset($GLOBALS['BE_USER']);
34-
parent::tearDown();
3534
}
3635

3736
#[Test]

Tests/Unit/Service/Menu/ContentElementButtonBuilderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ final class ContentElementButtonBuilderTest extends TestCase
3939

4040
protected function setUp(): void
4141
{
42-
parent::setUp();
43-
4442
$iconMock = $this->createMock(Icon::class);
4543
$iconFactoryMock = $this->createMock(IconFactory::class);
4644
$iconFactoryMock->method('getIcon')->willReturn($iconMock);
@@ -55,7 +53,6 @@ protected function setUp(): void
5553
protected function tearDown(): void
5654
{
5755
GeneralUtility::purgeInstances();
58-
parent::tearDown();
5956
}
6057

6158
#[Test]

Tests/Unit/Service/Menu/ContentElementMenuGeneratorTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ final class ContentElementMenuGeneratorTest extends TestCase
4343
{
4444
protected function setUp(): void
4545
{
46-
parent::setUp();
47-
4846
$uriBuilderMock = $this->createMock(UriBuilder::class);
4947
$uriBuilderMock->method('buildUriFromRoute')->willReturn(new Uri('/typo3/mock'));
5048
GeneralUtility::setSingletonInstance(UriBuilder::class, $uriBuilderMock);
@@ -54,7 +52,6 @@ protected function tearDown(): void
5452
{
5553
GeneralUtility::purgeInstances();
5654
unset($GLOBALS['BE_USER'], $GLOBALS['LANG']);
57-
parent::tearDown();
5855
}
5956

6057
#[Test]

Tests/Unit/Service/Menu/PageButtonBuilderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ final class PageButtonBuilderTest extends TestCase
3838

3939
protected function setUp(): void
4040
{
41-
parent::setUp();
42-
4341
$iconMock = $this->createMock(Icon::class);
4442
$iconFactoryMock = $this->createMock(IconFactory::class);
4543
$iconFactoryMock->method('getIcon')->willReturn($iconMock);
@@ -55,7 +53,6 @@ protected function tearDown(): void
5553
{
5654
GeneralUtility::purgeInstances();
5755
unset($GLOBALS['LANG'], $GLOBALS['TCA']);
58-
parent::tearDown();
5956
}
6057

6158
#[Test]

Tests/Unit/Service/Menu/PageMenuGeneratorTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ final class PageMenuGeneratorTest extends TestCase
3939
{
4040
protected function setUp(): void
4141
{
42-
parent::setUp();
43-
4442
$uriBuilderMock = $this->createMock(UriBuilder::class);
4543
$uriBuilderMock->method('buildUriFromRoute')->willReturn(new Uri('/typo3/mock'));
4644
GeneralUtility::setSingletonInstance(UriBuilder::class, $uriBuilderMock);
@@ -49,7 +47,6 @@ protected function setUp(): void
4947
protected function tearDown(): void
5048
{
5149
GeneralUtility::purgeInstances();
52-
parent::tearDown();
5350
}
5451

5552
#[Test]

Tests/Unit/Service/Ui/UrlBuilderServiceTest.php

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,20 @@ final class UrlBuilderServiceTest extends TestCase
3434

3535
protected function setUp(): void
3636
{
37-
parent::setUp();
38-
3937
$this->uriBuilderMock = $this->createMock(UriBuilder::class);
4038
GeneralUtility::setSingletonInstance(UriBuilder::class, $this->uriBuilderMock);
4139
}
4240

4341
protected function tearDown(): void
4442
{
4543
GeneralUtility::purgeInstances();
46-
parent::tearDown();
4744
}
4845

4946
#[Test]
5047
public function buildEditUrlReturnsCorrectUrl(): void
5148
{
5249
$this->uriBuilderMock->method('buildUriFromRoute')
53-
->with('record_edit', self::callback(static function (array $params): bool {
54-
return isset($params['edit']['tt_content'][1]) && 'edit' === $params['edit']['tt_content'][1];
55-
}))
50+
->with('record_edit', self::callback(static fn(array $params): bool => isset($params['edit']['tt_content'][1]) && 'edit' === $params['edit']['tt_content'][1]))
5651
->willReturn(new Uri('/typo3/record/edit'));
5752

5853
$service = new UrlBuilderService();
@@ -65,9 +60,7 @@ public function buildEditUrlReturnsCorrectUrl(): void
6560
public function buildPageLayoutUrlReturnsCorrectUrl(): void
6661
{
6762
$this->uriBuilderMock->method('buildUriFromRoute')
68-
->with('web_layout', self::callback(static function (array $params): bool {
69-
return 1 === $params['id'] && 0 === $params['language'];
70-
}))
63+
->with('web_layout', self::callback(static fn(array $params): bool => 1 === $params['id'] && 0 === $params['language']))
7164
->willReturn(new Uri('/typo3/module/web/layout'));
7265

7366
$service = new UrlBuilderService();
@@ -80,9 +73,7 @@ public function buildPageLayoutUrlReturnsCorrectUrl(): void
8073
public function buildPageLayoutUrlIncludesScrollToElement(): void
8174
{
8275
$this->uriBuilderMock->method('buildUriFromRoute')
83-
->with('web_layout', self::callback(static function (array $params): bool {
84-
return isset($params['scrollToElement']) && 42 === $params['scrollToElement'];
85-
}))
76+
->with('web_layout', self::callback(static fn(array $params): bool => isset($params['scrollToElement']) && 42 === $params['scrollToElement']))
8677
->willReturn(new Uri('/typo3/module/web/layout'));
8778

8879
$service = new UrlBuilderService();
@@ -108,9 +99,7 @@ public function buildHideUrlReturnsCorrectUrl(): void
10899
public function buildInfoUrlReturnsCorrectUrl(): void
109100
{
110101
$this->uriBuilderMock->method('buildUriFromRoute')
111-
->with('show_item', self::callback(static function (array $params): bool {
112-
return 1 === $params['uid'] && 'tt_content' === $params['table'];
113-
}))
102+
->with('show_item', self::callback(static fn(array $params): bool => 1 === $params['uid'] && 'tt_content' === $params['table']))
114103
->willReturn(new Uri('/typo3/show_item'));
115104

116105
$service = new UrlBuilderService();
@@ -136,9 +125,7 @@ public function buildMoveUrlReturnsCorrectUrl(): void
136125
public function buildHistoryUrlReturnsCorrectUrl(): void
137126
{
138127
$this->uriBuilderMock->method('buildUriFromRoute')
139-
->with('record_history', self::callback(static function (array $params): bool {
140-
return 'tt_content:1' === $params['element'];
141-
}))
128+
->with('record_history', self::callback(static fn(array $params): bool => 'tt_content:1' === $params['element']))
142129
->willReturn(new Uri('/typo3/record_history'));
143130

144131
$service = new UrlBuilderService();
@@ -151,9 +138,7 @@ public function buildHistoryUrlReturnsCorrectUrl(): void
151138
public function buildNewContentAfterUrlReturnsCorrectUrl(): void
152139
{
153140
$this->uriBuilderMock->method('buildUriFromRoute')
154-
->with('record_edit', self::callback(static function (array $params): bool {
155-
return isset($params['edit']['tt_content'][-1]) && 'new' === $params['edit']['tt_content'][-1];
156-
}))
141+
->with('record_edit', self::callback(static fn(array $params): bool => isset($params['edit']['tt_content'][-1]) && 'new' === $params['edit']['tt_content'][-1]))
157142
->willReturn(new Uri('/typo3/record/edit'));
158143

159144
$service = new UrlBuilderService();

0 commit comments

Comments
 (0)