diff --git a/.upgrade.yml b/.upgrade.yml index 6432d7c0..c63af4fb 100644 --- a/.upgrade.yml +++ b/.upgrade.yml @@ -1,6 +1,8 @@ mappings: - SS_Report: SilverStripe\Reports\SS_Report - SS_ReportWrapper: SilverStripe\Reports\SS_ReportWrapper + SS_Report: SilverStripe\Reports\Report + SilverStripe\Reports\SS_Report: SilverStripe\Reports\Report + SS_ReportWrapper: SilverStripe\Reports\ReportWrapper + SilverStripe\Reports\SS_ReportWrapper: SilverStripe\Reports\ReportWrapper ReportAdmin: SilverStripe\Reports\ReportAdmin SideReportView: SilverStripe\Reports\SideReportView SideReportWrapper: SilverStripe\Reports\SideReportWrapper diff --git a/code/Report.php b/code/Report.php index b43905f3..e7fb3ae3 100644 --- a/code/Report.php +++ b/code/Report.php @@ -52,7 +52,7 @@ use ReflectionClass; * 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. */ -class SS_Report extends ViewableData +class Report extends ViewableData { /** * This is the title of the report, @@ -88,8 +88,8 @@ class SS_Report extends ViewableData * @var array */ public static $excluded_reports = array( - 'SilverStripe\\Reports\\SS_Report', - 'SilverStripe\\Reports\\SS_ReportWrapper', + 'SilverStripe\\Reports\\Report', + 'SilverStripe\\Reports\\ReportWrapper', 'SilverStripe\\Reports\\SideReportWrapper', ); @@ -189,8 +189,8 @@ class SS_Report extends ViewableData /** * counts the number of objects returned - * @param Array $params - any parameters for the sourceRecords - * @return Int + * @param array $params - any parameters for the sourceRecords + * @return int */ public function getCount($params = array()) { diff --git a/code/ReportAdmin.php b/code/ReportAdmin.php index e533dd05..ba3fbe37 100644 --- a/code/ReportAdmin.php +++ b/code/ReportAdmin.php @@ -36,7 +36,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider private static $template_path = null; // defaults to (project)/templates/email - private static $tree_class = 'SilverStripe\\Reports\\SS_Report'; + private static $tree_class = 'SilverStripe\\Reports\\Report'; private static $url_handlers = array( 'show/$ReportClass/$Action' => 'handleAction' @@ -51,7 +51,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider protected $reportClass; /** - * @var SS_Report + * @var Report */ protected $reportObject; @@ -107,8 +107,8 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider public function Reports() { $output = new ArrayList(); - /** @var SS_Report $report */ - foreach (SS_Report::get_reports() as $report) { + /** @var Report $report */ + foreach (Report::get_reports() as $report) { if ($report->canView()) { $output->push($report); } @@ -122,7 +122,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider // Check report if ($this->reportClass) { - $allReports = SS_Report::get_reports(); + $allReports = Report::get_reports(); if (empty($allReports[$this->reportClass])) { return $this->httpError(404); } @@ -156,7 +156,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider */ public static function has_reports() { - return sizeof(SS_Report::get_reports()) > 0; + return sizeof(Report::get_reports()) > 0; } /** diff --git a/code/SS_ReportWrapper.php b/code/ReportWrapper.php similarity index 98% rename from code/SS_ReportWrapper.php rename to code/ReportWrapper.php index cd2cc930..3287a459 100644 --- a/code/SS_ReportWrapper.php +++ b/code/ReportWrapper.php @@ -15,7 +15,7 @@ namespace SilverStripe\Reports; * It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and * {@link afterQuery()} */ -abstract class SS_ReportWrapper extends SS_Report +abstract class ReportWrapper extends Report { protected $baseReport; diff --git a/code/SideReportWrapper.php b/code/SideReportWrapper.php index c6f54b0d..94d96953 100644 --- a/code/SideReportWrapper.php +++ b/code/SideReportWrapper.php @@ -7,7 +7,7 @@ namespace SilverStripe\Reports; * * This report wrapper will use sideReportColumns() for the report columns, instead of columns(). */ -class SideReportWrapper extends SS_ReportWrapper +class SideReportWrapper extends ReportWrapper { public function columns() { diff --git a/tests/ReportTest.php b/tests/ReportTest.php index 69ff6a8a..b19a4d1c 100644 --- a/tests/ReportTest.php +++ b/tests/ReportTest.php @@ -1,7 +1,7 @@ assertNotNull($reports, "Reports returned"); $previousSort = 0; foreach ($reports as $report) { @@ -28,7 +28,7 @@ class ReportTest extends SapphireTest public function testExcludeReport() { - $reports = SS_Report::get_reports(); + $reports = Report::get_reports(); $reportNames = array(); foreach ($reports as $report) { $reportNames[] = $report->class; @@ -36,9 +36,9 @@ class ReportTest extends SapphireTest $this->assertContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is in reports list'); //exclude one report - SS_Report::add_excluded_reports('ReportTest_FakeTest'); + Report::add_excluded_reports('ReportTest_FakeTest'); - $reports = SS_Report::get_reports(); + $reports = Report::get_reports(); $reportNames = array(); foreach ($reports as $report) { $reportNames[] = $report->class; @@ -46,9 +46,9 @@ class ReportTest extends SapphireTest $this->assertNotContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is NOT in reports list'); //exclude two reports - SS_Report::add_excluded_reports(array('ReportTest_FakeTest', 'ReportTest_FakeTest2')); + Report::add_excluded_reports(array('ReportTest_FakeTest', 'ReportTest_FakeTest2')); - $reports = SS_Report::get_reports(); + $reports = Report::get_reports(); $reportNames = array(); foreach ($reports as $report) { $reportNames[] = $report->class; @@ -59,7 +59,7 @@ class ReportTest extends SapphireTest public function testAbstractClassesAreExcluded() { - $reports = SS_Report::get_reports(); + $reports = Report::get_reports(); $reportNames = array(); foreach ($reports as $report) { $reportNames[] = $report->class; @@ -95,7 +95,7 @@ class ReportTest extends SapphireTest * @package reports * @subpackage tests */ -class ReportTest_FakeTest extends SS_Report implements TestOnly +class ReportTest_FakeTest extends Report implements TestOnly { public function title() { @@ -124,7 +124,7 @@ class ReportTest_FakeTest extends SS_Report implements TestOnly * @package reports * @subpackage tests */ -class ReportTest_FakeTest2 extends SS_Report implements TestOnly +class ReportTest_FakeTest2 extends Report implements TestOnly { public function title() { @@ -153,7 +153,7 @@ class ReportTest_FakeTest2 extends SS_Report implements TestOnly * @package reports * @subpackage tests */ -abstract class ReportTest_FakeTest_Abstract extends SS_Report implements TestOnly +abstract class ReportTest_FakeTest_Abstract extends Report implements TestOnly { public function title()