ENHANCEMENT: Remove unused $controller from lambda function

This commit is contained in:
mattclegg 2020-04-04 14:29:00 +05:45
parent 9cb96bfc52
commit 2bbc280ce6
No known key found for this signature in database
GPG Key ID: 38F89AD4DDF94EC3

View File

@ -1674,9 +1674,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
'getTreeTitle' => 'HTMLFragment' 'getTreeTitle' => 'HTMLFragment'
)); ));
$controller = $this;
$columns->setFieldFormatting(array( $columns->setFieldFormatting(array(
'listChildrenLink' => function ($value, &$item) use ($controller) { 'listChildrenLink' => function ($value, &$item) {
/** @var SiteTree $item */ /** @var SiteTree $item */
$num = $item ? $item->numChildren() : null; $num = $item ? $item->numChildren() : null;
if ($num) { if ($num) {
@ -1687,7 +1686,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
); );
} }
}, },
'getTreeTitle' => function ($value, &$item) use ($controller) { 'getTreeTitle' => function ($value, &$item) {
$title = sprintf( $title = sprintf(
'<a class="action-detail" href="%s">%s</a>', '<a class="action-detail" href="%s">%s</a>',
Controller::join_links( Controller::join_links(