Skip to content

Commit a8b87d9

Browse files
Fix linter errors
1 parent 2f6c8dc commit a8b87d9

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

doc/fields/AssociationField.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ to allow HTML rendering::
139139

140140
By default, to-one associations link to the ``detail`` page of the related entity
141141
and to-many associations are rendered as a plain badge with a count. Use this
142-
option to replace that behaviour with a custom URL.
142+
option to replace that behavior with a custom URL.
143143

144144
Pass a static string when the URL is known at configuration time::
145145

@@ -178,8 +178,6 @@ For **to-many** associations, the count badge becomes clickable (rendered as an
178178
// to-many: renders a clickable badge with the count
179179
yield AssociationField::new('tags')->linkToUrl('https://example.com/tags');
180180

181-
182-
183181
``renderAsNativeWidget``
184182
~~~~~~~~~~~~~~~~~~~~~~~~
185183

src/Field/Configurator/AssociationConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
217217
}
218218

219219
$url = $field->getCustomOption(AssociationField::OPTION_URL);
220-
if (is_callable($url)) {
220+
if (\is_callable($url)) {
221221
$url = $url($entityDto, $context);
222222
$field->setCustomOption(AssociationField::OPTION_URL, $url);
223223
}

tests/Unit/Field/Configurator/AssociationConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function testLinkToUrl(): void
257257
public function testLinkToUrlCallable(): void
258258
{
259259
$field = $this->buildLeadDeveloperField()
260-
->linkToUrl(function(EntityDto $entityDto, AdminContextInterface $context) {
260+
->linkToUrl(static function (EntityDto $entityDto, AdminContextInterface $context) {
261261
return sprintf('https://example.com/%s/%s', $context->getRequest()->getLocale(), $entityDto->getName());
262262
})
263263
;

0 commit comments

Comments
 (0)