From 77991cd25271cd3c43fe90fd60f4e71484c6221f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Fri, 12 Jan 2024 11:49:33 +1300 Subject: [PATCH] ENH Add generic types --- src/Extension/CustomHtmlEditorField.php | 3 ++- src/Extension/CwpHtmlEditorConfig.php | 5 ++++- src/Extension/LoginAttemptNotifications.php | 7 ++----- src/Extension/RichLinksExtension.php | 4 +++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Extension/CustomHtmlEditorField.php b/src/Extension/CustomHtmlEditorField.php index 994c8b6..17a7307 100644 --- a/src/Extension/CustomHtmlEditorField.php +++ b/src/Extension/CustomHtmlEditorField.php @@ -9,10 +9,11 @@ /** * @todo rename file to match class name * @todo investigate updated HTMLEditorField_Toolbar changes, and find new implementation + * + * @extends Extension<\HtmlEditorField_Toolbar> */ class CustomHtmlEditorFieldToolbar extends Extension { - /** * @param Form $form * @return void diff --git a/src/Extension/CwpHtmlEditorConfig.php b/src/Extension/CwpHtmlEditorConfig.php index da6b0b1..8c35f61 100644 --- a/src/Extension/CwpHtmlEditorConfig.php +++ b/src/Extension/CwpHtmlEditorConfig.php @@ -3,10 +3,13 @@ namespace CWP\Core\Extension; use SilverStripe\ORM\DataExtension; +use SilverStripe\Security\Group; +/** + * @extends DataExtension + */ class CwpHtmlEditorConfig extends DataExtension { - /** * @return string * diff --git a/src/Extension/LoginAttemptNotifications.php b/src/Extension/LoginAttemptNotifications.php index 796b30d..82d2b25 100644 --- a/src/Extension/LoginAttemptNotifications.php +++ b/src/Extension/LoginAttemptNotifications.php @@ -14,18 +14,15 @@ * TODO: bug when using default admin - always shows the message... * Requires Security::login_recording config to be set to true. * - * @property LeftAndMain $owner + * @extends Extension */ class LoginAttemptNotifications extends Extension { - /** - * - * @return mixed null + * @return mixed */ public function init() { - // Exclude default admin. $member = Security::getCurrentUser(); if (!$member || !$member->ID) { diff --git a/src/Extension/RichLinksExtension.php b/src/Extension/RichLinksExtension.php index 1d2b56f..10cb526 100644 --- a/src/Extension/RichLinksExtension.php +++ b/src/Extension/RichLinksExtension.php @@ -5,6 +5,7 @@ use SilverStripe\Core\Extension; use SilverStripe\ORM\DataObject; use SilverStripe\Assets\File; +use SilverStripe\ORM\FieldType\DBField; /** * Adds capability to augment links with extra attributes and meta information. @@ -13,10 +14,11 @@ * $Content.RichLinks * * Note: will only work with content produced by HtmlEditorField. + * + * @extends Extension */ class RichLinksExtension extends Extension { - /** * @var array */