Skip to content

Commit af59718

Browse files
Fix lint (#8331)
1 parent f3e2b62 commit af59718

File tree

9 files changed

+29
-64
lines changed

9 files changed

+29
-64
lines changed

tests/Admin/AdminHelperTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ public function setCollection(Collection $collection): void
754754
private function getMethodAsPublic(string $privateMethod): \ReflectionMethod
755755
{
756756
$reflectionMethod = new \ReflectionMethod(AdminHelper::class, $privateMethod);
757-
$reflectionMethod->setAccessible(true);
758757

759758
return $reflectionMethod;
760759
}

tests/Controller/CRUDControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ static function (string $name, object $object, array $parameters = []): string {
299299
];
300300
foreach ($testedMethods as $testedMethod) {
301301
$method = new \ReflectionMethod(CRUDController::class, $testedMethod);
302-
$method->setAccessible(true);
303302
$this->protectedTestedMethods[$testedMethod] = $method;
304303
}
305304
}

tests/Datagrid/PagerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ protected function callMethod(object $obj, string $name, array $args = []): mixe
229229
{
230230
$class = new \ReflectionClass($obj);
231231
$method = $class->getMethod($name);
232-
$method->setAccessible(true);
233232

234233
return $method->invokeArgs($obj, $args);
235234
}

tests/DependencyInjection/Compiler/AddDependencyCallsCompilerPassTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testProcessParsingFullValidConfig(): void
115115

116116
static::assertArrayHasKey('sonata_group_two', $dashboardGroupsSettings);
117117
static::assertArrayHasKey('provider', $dashboardGroupsSettings['sonata_group_two']);
118-
static::assertStringContainsString('my_menu', $dashboardGroupsSettings['sonata_group_two']['provider']);
118+
static::assertStringContainsString('my_menu', (string) $dashboardGroupsSettings['sonata_group_two']['provider']);
119119

120120
static::assertArrayHasKey('sonata_group_five', $dashboardGroupsSettings);
121121
static::assertTrue($dashboardGroupsSettings['sonata_group_five']['keep_open']);
@@ -160,14 +160,14 @@ public function testProcessResultingConfig(): void
160160
static::assertFalse($adminGroups['sonata_group_one']['keep_open']);
161161
static::assertStringContainsString(
162162
'sonata_post_admin',
163-
$adminGroups['sonata_group_one']['items'][0]['admin']
163+
(string) $adminGroups['sonata_group_one']['items'][0]['admin']
164164
);
165165
static::assertNotContains('sonata_article_admin', $adminGroups['sonata_group_one']['items']);
166166
static::assertContains('ROLE_ONE', $adminGroups['sonata_group_one']['roles']);
167167

168168
static::assertArrayHasKey('sonata_group_two', $adminGroups);
169169
static::assertArrayHasKey('provider', $adminGroups['sonata_group_two']);
170-
static::assertStringContainsString('my_menu', $adminGroups['sonata_group_two']['provider']);
170+
static::assertStringContainsString('my_menu', (string) $adminGroups['sonata_group_two']['provider']);
171171

172172
static::assertArrayHasKey('sonata_group_five', $adminGroups);
173173
static::assertTrue($adminGroups['sonata_group_five']['keep_open']);

tests/DependencyInjection/Compiler/ExtensionCompilerPassTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ public function testFlattenEmptyExtensionConfiguration(): void
8989
ExtensionCompilerPass::class,
9090
'flattenExtensionConfiguration'
9191
);
92-
93-
$method->setAccessible(true);
9492
$extensionMap = $method->invokeArgs(new ExtensionCompilerPass(), [$extensionMap]);
9593

9694
static::assertIsArray($extensionMap);
@@ -123,8 +121,6 @@ public function testFlattenExtensionConfiguration(): void
123121
ExtensionCompilerPass::class,
124122
'flattenExtensionConfiguration'
125123
);
126-
127-
$method->setAccessible(true);
128124
$extensionMap = $method->invokeArgs(new ExtensionCompilerPass(), [$extensionMap]);
129125

130126
static::assertIsArray($extensionMap);

tests/FieldDescription/BaseFieldDescriptionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ protected function callMethod(object $obj, string $name, array $args = []): mixe
271271
{
272272
$class = new \ReflectionClass($obj);
273273
$method = $class->getMethod($name);
274-
$method->setAccessible(true);
275274

276275
return $method->invokeArgs($obj, $args);
277276
}

tests/Form/Widget/FormSonataFilterChoiceWidgetTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ protected function getExtensions(): array
7474
if (!$extension->hasType($this->getChoiceClass())) {
7575
$reflection = new \ReflectionClass($extension);
7676
$property = $reflection->getProperty('types');
77-
$property->setAccessible(true);
7877
$types = $property->getValue($extension);
7978
\assert(\is_array($types));
8079
$property->setValue($extension, [$type::class => current($types)]);

tests/Twig/Extension/RenderElementExtensionTest.php

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,7 @@ class="x-editable"
875875
<span class="label label-success">yes</span>
876876
</span>
877877
</td>
878-
EOT
879-
,
878+
EOT,
880879
FieldDescriptionInterface::TYPE_BOOLEAN,
881880
true,
882881
['editable' => true],
@@ -895,8 +894,7 @@ class="x-editable"
895894
>
896895
<span class="label label-danger">no</span> </span>
897896
</td>
898-
EOT
899-
,
897+
EOT,
900898
FieldDescriptionInterface::TYPE_BOOLEAN,
901899
false,
902900
['editable' => true],
@@ -914,8 +912,7 @@ class="x-editable"
914912
data-source="[{value: 0, text: 'no'},{value: 1, text: 'yes'}]" >
915913
<span class="label label-danger">no</span> </span>
916914
</td>
917-
EOT
918-
,
915+
EOT,
919916
FieldDescriptionInterface::TYPE_BOOLEAN,
920917
null,
921918
['editable' => true],
@@ -1084,8 +1081,7 @@ class="x-editable"
10841081
Status1
10851082
</span>
10861083
</td>
1087-
EOT
1088-
,
1084+
EOT,
10891085
FieldDescriptionInterface::TYPE_CHOICE,
10901086
'Status1',
10911087
['editable' => true],
@@ -1103,8 +1099,7 @@ class="x-editable"
11031099
data-source="[{&quot;value&quot;:&quot;Status1&quot;,&quot;text&quot;:&quot;Alias1&quot;},{&quot;value&quot;:&quot;Status2&quot;,&quot;text&quot;:&quot;Alias2&quot;},{&quot;value&quot;:&quot;Status3&quot;,&quot;text&quot;:&quot;Alias3&quot;}]" >
11041100
Alias1 </span>
11051101
</td>
1106-
EOT
1107-
,
1102+
EOT,
11081103
FieldDescriptionInterface::TYPE_CHOICE,
11091104
'Status1',
11101105
[
@@ -1130,8 +1125,7 @@ class="x-editable"
11301125
11311126
</span>
11321127
</td>
1133-
EOT
1134-
,
1128+
EOT,
11351129
FieldDescriptionInterface::TYPE_CHOICE,
11361130
null,
11371131
[
@@ -1156,8 +1150,7 @@ class="x-editable"
11561150
NoValidKeyInChoices
11571151
</span>
11581152
</td>
1159-
EOT
1160-
,
1153+
EOT,
11611154
FieldDescriptionInterface::TYPE_CHOICE,
11621155
'NoValidKeyInChoices',
11631156
[
@@ -1183,8 +1176,7 @@ class="x-editable"
11831176
Delete
11841177
</span>
11851178
</td>
1186-
EOT
1187-
,
1179+
EOT,
11881180
FieldDescriptionInterface::TYPE_CHOICE,
11891181
'Foo',
11901182
[
@@ -1469,8 +1461,7 @@ class="sonata-readmore-btn btn-link"
14691461
data-action="click->sonata-readmore#toggle"></button>
14701462
</div>
14711463
</td>
1472-
EOT
1473-
,
1464+
EOT,
14741465
FieldDescriptionInterface::TYPE_STRING,
14751466
'A very long string',
14761467
[
@@ -1492,8 +1483,7 @@ class="sonata-readmore-btn btn-link"
14921483
data-action="click->sonata-readmore#toggle"></button>
14931484
</div>
14941485
</td>
1495-
EOT
1496-
,
1486+
EOT,
14971487
FieldDescriptionInterface::TYPE_STRING,
14981488
'A very long string',
14991489
[
@@ -1518,8 +1508,7 @@ class="x-editable"
15181508
Delete, Alias2
15191509
</span>
15201510
</td>
1521-
EOT
1522-
,
1511+
EOT,
15231512
FieldDescriptionInterface::TYPE_CHOICE,
15241513
[
15251514
'Status1',
@@ -2086,8 +2075,7 @@ class="sonata-readmore-btn btn-link"
20862075
data-action="click->sonata-readmore#toggle"></button>
20872076
</div>
20882077
</td>
2089-
EOT
2090-
,
2078+
EOT,
20912079
FieldDescriptionInterface::TYPE_STRING,
20922080
' A very long string ',
20932081
[
@@ -2110,8 +2098,7 @@ class="sonata-readmore-btn btn-link"
21102098
data-action="click->sonata-readmore#toggle"></button>
21112099
</div>
21122100
</td>
2113-
EOT
2114-
,
2101+
EOT,
21152102
FieldDescriptionInterface::TYPE_STRING,
21162103
' A very long string ',
21172104
[

tests/Twig/RenderElementRuntimeTest.php

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,7 @@ class="x-editable"
831831
<span class="label label-success">yes</span>
832832
</span>
833833
</td>
834-
EOT
835-
,
834+
EOT,
836835
FieldDescriptionInterface::TYPE_BOOLEAN,
837836
true,
838837
['editable' => true],
@@ -851,8 +850,7 @@ class="x-editable"
851850
>
852851
<span class="label label-danger">no</span> </span>
853852
</td>
854-
EOT
855-
,
853+
EOT,
856854
FieldDescriptionInterface::TYPE_BOOLEAN,
857855
false,
858856
['editable' => true],
@@ -870,8 +868,7 @@ class="x-editable"
870868
data-source="[{value: 0, text: 'no'},{value: 1, text: 'yes'}]" >
871869
<span class="label label-danger">no</span> </span>
872870
</td>
873-
EOT
874-
,
871+
EOT,
875872
FieldDescriptionInterface::TYPE_BOOLEAN,
876873
null,
877874
['editable' => true],
@@ -1040,8 +1037,7 @@ class="x-editable"
10401037
Status1
10411038
</span>
10421039
</td>
1043-
EOT
1044-
,
1040+
EOT,
10451041
FieldDescriptionInterface::TYPE_CHOICE,
10461042
'Status1',
10471043
['editable' => true],
@@ -1059,8 +1055,7 @@ class="x-editable"
10591055
data-source="[{&quot;value&quot;:&quot;Status1&quot;,&quot;text&quot;:&quot;Alias1&quot;},{&quot;value&quot;:&quot;Status2&quot;,&quot;text&quot;:&quot;Alias2&quot;},{&quot;value&quot;:&quot;Status3&quot;,&quot;text&quot;:&quot;Alias3&quot;}]" >
10601056
Alias1 </span>
10611057
</td>
1062-
EOT
1063-
,
1058+
EOT,
10641059
FieldDescriptionInterface::TYPE_CHOICE,
10651060
'Status1',
10661061
[
@@ -1086,8 +1081,7 @@ class="x-editable"
10861081
10871082
</span>
10881083
</td>
1089-
EOT
1090-
,
1084+
EOT,
10911085
FieldDescriptionInterface::TYPE_CHOICE,
10921086
null,
10931087
[
@@ -1112,8 +1106,7 @@ class="x-editable"
11121106
NoValidKeyInChoices
11131107
</span>
11141108
</td>
1115-
EOT
1116-
,
1109+
EOT,
11171110
FieldDescriptionInterface::TYPE_CHOICE,
11181111
'NoValidKeyInChoices',
11191112
[
@@ -1139,8 +1132,7 @@ class="x-editable"
11391132
Delete
11401133
</span>
11411134
</td>
1142-
EOT
1143-
,
1135+
EOT,
11441136
FieldDescriptionInterface::TYPE_CHOICE,
11451137
'Foo',
11461138
[
@@ -1419,8 +1411,7 @@ class="sonata-readmore-btn btn-link"
14191411
data-action="click->sonata-readmore#toggle"></button>
14201412
</div>
14211413
</td>
1422-
EOT
1423-
,
1414+
EOT,
14241415
FieldDescriptionInterface::TYPE_STRING,
14251416
'A very long string',
14261417
[
@@ -1442,8 +1433,7 @@ class="sonata-readmore-btn btn-link"
14421433
data-action="click->sonata-readmore#toggle"></button>
14431434
</div>
14441435
</td>
1445-
EOT
1446-
,
1436+
EOT,
14471437
FieldDescriptionInterface::TYPE_STRING,
14481438
'A very long string',
14491439
[
@@ -1468,8 +1458,7 @@ class="x-editable"
14681458
Delete, Alias2
14691459
</span>
14701460
</td>
1471-
EOT
1472-
,
1461+
EOT,
14731462
FieldDescriptionInterface::TYPE_CHOICE,
14741463
[
14751464
'Status1',
@@ -1973,8 +1962,7 @@ class="sonata-readmore-btn btn-link"
19731962
data-action="click->sonata-readmore#toggle"></button>
19741963
</div>
19751964
</td>
1976-
EOT
1977-
,
1965+
EOT,
19781966
FieldDescriptionInterface::TYPE_STRING,
19791967
' A very long string ',
19801968
[
@@ -1997,8 +1985,7 @@ class="sonata-readmore-btn btn-link"
19971985
data-action="click->sonata-readmore#toggle"></button>
19981986
</div>
19991987
</td>
2000-
EOT
2001-
,
1988+
EOT,
20021989
FieldDescriptionInterface::TYPE_STRING,
20031990
' A very long string ',
20041991
[

0 commit comments

Comments
 (0)