MNT Remove unnecessary @var comments (#172)

This commit is contained in:
Guy Sartorelli 2024-01-24 09:40:47 +13:00 committed by GitHub
parent 0ba023dd16
commit 16a20fc3ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 10 deletions

View File

@ -401,9 +401,7 @@ class Report extends ViewableData
GridFieldDataColumns::create(), GridFieldDataColumns::create(),
GridFieldPaginator::create() GridFieldPaginator::create()
); );
/** @var GridField $gridField */
$gridField = GridField::create('Report', null, $items, $gridFieldConfig); $gridField = GridField::create('Report', null, $items, $gridFieldConfig);
/** @var GridFieldDataColumns $columns */
$columns = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class); $columns = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
$displayFields = []; $displayFields = [];
$fieldCasting = []; $fieldCasting = [];
@ -431,7 +429,6 @@ class Report extends ViewableData
} else { } else {
$fieldFormatting[$source] = function ($value, $item) { $fieldFormatting[$source] = function ($value, $item) {
if ($item instanceof CMSPreviewable) { if ($item instanceof CMSPreviewable) {
/** @var CMSPreviewable $item */
return sprintf( return sprintf(
'<a class="grid-field__link-block" href="%s" title="%s">%s</a>', '<a class="grid-field__link-block" href="%s" title="%s">%s</a>',
Convert::raw2att($item->CMSEditLink()), Convert::raw2att($item->CMSEditLink()),
@ -532,7 +529,6 @@ class Report extends ViewableData
{ {
$params = []; $params = [];
if (Injector::inst()->has(HTTPRequest::class)) { if (Injector::inst()->has(HTTPRequest::class)) {
/** @var HTTPRequest $request */
$request = Injector::inst()->get(HTTPRequest::class); $request = Injector::inst()->get(HTTPRequest::class);
$params = $request->param('filters') ?: $request->requestVar('filters') ?: []; $params = $request->param('filters') ?: $request->requestVar('filters') ?: [];
} }

View File

@ -105,7 +105,6 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
public function Reports() public function Reports()
{ {
$output = new ArrayList(); $output = new ArrayList();
/** @var Report $report */
foreach (Report::get_reports() as $report) { foreach (Report::get_reports() as $report) {
if ($report->canView()) { if ($report->canView()) {
$output->push($report); $output->push($report);
@ -160,9 +159,6 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
/** /**
* Returns the Breadcrumbs for the ReportAdmin * Returns the Breadcrumbs for the ReportAdmin
*
* @param bool $unlinked
* @return ArrayList
*/ */
public function Breadcrumbs($unlinked = false) public function Breadcrumbs($unlinked = false)
{ {
@ -235,9 +231,8 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
GridFieldFooter::create() GridFieldFooter::create()
); );
$gridField = GridField::create('Reports', false, $this->Reports(), $gridFieldConfig); $gridField = GridField::create('Reports', false, $this->Reports(), $gridFieldConfig);
/** @var GridFieldDataColumns $columns */
$columns = $gridField->getConfig() $columns = $gridField->getConfig()
->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns'); ->getComponentByType(GridFieldDataColumns::class);
$columns->setDisplayFields(array( $columns->setDisplayFields(array(
'title' => _t('SilverStripe\\Reports\\ReportAdmin.ReportTitle', 'Title'), 'title' => _t('SilverStripe\\Reports\\ReportAdmin.ReportTitle', 'Title'),
)); ));