From 3e3a795a5bc4f3fcb0b8e51e0b8a0819e72a2213 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 11 Jan 2024 14:06:14 +1300 Subject: [PATCH] ENH Add generic types --- src/ErrorPage.php | 2 -- src/ErrorPageController.php | 3 ++- src/ErrorPageControllerExtension.php | 4 +++- src/ErrorPageFileExtension.php | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ErrorPage.php b/src/ErrorPage.php index 448efd9..653e2dc 100644 --- a/src/ErrorPage.php +++ b/src/ErrorPage.php @@ -110,7 +110,6 @@ public function canAddChildren($member = null) public static function response_for($statusCode, $errorMessage = null) { // first attempt to dynamically generate the error page - /** @var ErrorPage $errorPage */ $errorPage = ErrorPage::get() ->filter([ "ErrorCode" => $statusCode @@ -185,7 +184,6 @@ protected function requireDefaultRecordFixture($defaultData) { $code = $defaultData['ErrorCode']; - /** @var ErrorPage $page */ $page = ErrorPage::get()->find('ErrorCode', $code); if (!$page) { $page = static::create(); diff --git a/src/ErrorPageController.php b/src/ErrorPageController.php index 80b6f58..fc4a753 100644 --- a/src/ErrorPageController.php +++ b/src/ErrorPageController.php @@ -8,6 +8,8 @@ /** * Controller for ErrorPages. + * + * @extends PageController */ class ErrorPageController extends PageController { @@ -30,7 +32,6 @@ protected function init() */ public function handleRequest(HTTPRequest $request): HTTPResponse { - /** @var ErrorPage $page */ $page = $this->data(); $response = parent::handleRequest($request); $response->setStatusCode($page->ErrorCode); diff --git a/src/ErrorPageControllerExtension.php b/src/ErrorPageControllerExtension.php index cd95af8..d2ccc2f 100644 --- a/src/ErrorPageControllerExtension.php +++ b/src/ErrorPageControllerExtension.php @@ -9,13 +9,15 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Core\Extension; +use SilverStripe\Forms\Form; /** * Enhances error handling for a controller with ErrorPage generated output + * + * @extends Extension */ class ErrorPageControllerExtension extends Extension { - /** * Used by {@see RequestHandler::httpError} * diff --git a/src/ErrorPageFileExtension.php b/src/ErrorPageFileExtension.php index 0880eed..e30747a 100644 --- a/src/ErrorPageFileExtension.php +++ b/src/ErrorPageFileExtension.php @@ -2,15 +2,17 @@ namespace SilverStripe\ErrorPage; +use SilverStripe\Assets\Shortcodes\FileShortcodeProvider; use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; /** * Decorates {@see File} with ErrorPage support + * + * @extends DataExtension */ class ErrorPageFileExtension extends DataExtension { - /** * Used by {@see File::handle_shortcode} *