mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENH Fix phpcs violations
This commit is contained in:
parent
c5f42d99a3
commit
213f7167a6
@ -61,7 +61,8 @@ use SilverStripe\View\ViewableData;
|
||||
* Right now, all subclasses of SS_Report will be shown in the ReportAdmin. In SS3 there is only
|
||||
* one place where reports can go, so this class is greatly simplifed from its version in SS2.
|
||||
*
|
||||
* @method SS_List|DataList sourceRecords($params = [], $sort = null, $limit = null) List of records to show for this report
|
||||
* @method SS_List|DataList sourceRecords($params = [], $sort = null, $limit = null)
|
||||
* List of records to show for this report
|
||||
*/
|
||||
class Report extends ViewableData
|
||||
{
|
||||
@ -158,7 +159,8 @@ class Report extends ViewableData
|
||||
{
|
||||
if (!$this->hasMethod('sourceRecords')) {
|
||||
throw new \RuntimeException(
|
||||
'Please override sourceQuery()/sourceRecords() and columns() or, if necessary, override getReportField()'
|
||||
'Please override sourceQuery()/sourceRecords() and columns() or, '
|
||||
. 'if necessary, override getReportField()'
|
||||
);
|
||||
}
|
||||
|
||||
@ -353,7 +355,10 @@ class Report extends ViewableData
|
||||
}
|
||||
|
||||
// Add a search button
|
||||
$formAction = FormAction::create('updatereport', _t('SilverStripe\\Forms\\GridField\\GridField.Filter', 'Filter'));
|
||||
$formAction = FormAction::create(
|
||||
'updatereport',
|
||||
_t('SilverStripe\\Forms\\GridField\\GridField.Filter', 'Filter')
|
||||
);
|
||||
$formAction->addExtraClass('btn-primary mb-4');
|
||||
|
||||
$fields->push($formAction);
|
||||
|
@ -181,13 +181,13 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
||||
}
|
||||
|
||||
//build breadcrumb trail to the current report
|
||||
$items->push(new ArrayData(array(
|
||||
$items->push(ArrayData::create([
|
||||
'Title' => $report->title(),
|
||||
'Link' => Controller::join_links(
|
||||
$this->Link(),
|
||||
'?' . http_build_query(array('q' => $this->request->requestVar('q')))
|
||||
'?' . http_build_query(['q' => $this->request->requestVar('q')])
|
||||
)
|
||||
)));
|
||||
]));
|
||||
}
|
||||
|
||||
return $items;
|
||||
@ -236,7 +236,8 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
||||
);
|
||||
$gridField = GridField::create('Reports', false, $this->Reports(), $gridFieldConfig);
|
||||
/** @var GridFieldDataColumns $columns */
|
||||
$columns = $gridField->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
|
||||
$columns = $gridField->getConfig()
|
||||
->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
|
||||
$columns->setDisplayFields(array(
|
||||
'title' => _t('SilverStripe\\Reports\\ReportAdmin.ReportTitle', 'Title'),
|
||||
));
|
||||
@ -250,7 +251,9 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
||||
|
||||
$actions = new FieldList();
|
||||
$form = new Form($this, "EditForm", $fields, $actions);
|
||||
$form->addExtraClass('panel panel--padded panel--scrollable cms-edit-form cms-panel-padded' . $this->BaseCSSClasses());
|
||||
$form->addExtraClass(
|
||||
'panel panel--padded panel--scrollable cms-edit-form cms-panel-padded' . $this->BaseCSSClasses()
|
||||
);
|
||||
$form->loadDataFrom($this->request->getVars());
|
||||
|
||||
$this->extend('updateEditForm', $form);
|
||||
|
@ -21,7 +21,7 @@ abstract class ReportWrapper extends Report
|
||||
|
||||
public function __construct($baseReport)
|
||||
{
|
||||
$this->baseReport = is_string($baseReport) ? new $baseReport : $baseReport;
|
||||
$this->baseReport = is_string($baseReport) ? new $baseReport() : $baseReport;
|
||||
$this->dataClass = $this->baseReport->dataClass();
|
||||
parent::__construct();
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ use SilverStripe\View\ViewableData;
|
||||
*/
|
||||
class SideReportView extends ViewableData
|
||||
{
|
||||
|
||||
protected $controller, $report;
|
||||
protected $controller;
|
||||
protected $report;
|
||||
protected $parameters;
|
||||
|
||||
public function __construct($controller, $report)
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\Reports\Tests;
|
||||
|
||||
use ReflectionClass;
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\Reports\Tests\ReportAdminTest;
|
||||
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\Reports\Tests\ReportAdminTest;
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
|
@ -8,7 +8,6 @@ use SilverStripe\Reports\Report;
|
||||
|
||||
abstract class FakeTestAbstract extends Report implements TestOnly
|
||||
{
|
||||
|
||||
public function title()
|
||||
{
|
||||
return 'Report title Abstract';
|
||||
|
Loading…
Reference in New Issue
Block a user