From 5feb53a6c74e0fb2c93e48f00736908e4a8fbe9e Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 11 Jan 2024 12:53:50 +1300 Subject: [PATCH] ENH Add generic types --- code/AuditHook.php | 5 ++++- code/AuditHookMFA.php | 4 ++++ code/AuditHookManyManyList.php | 4 ++++ code/AuditHookSessionManager.php | 3 +++ code/Extensions/ProxyDBExtension.php | 4 ++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/AuditHook.php b/code/AuditHook.php index a791fbe..6986e70 100644 --- a/code/AuditHook.php +++ b/code/AuditHook.php @@ -2,6 +2,8 @@ namespace SilverStripe\Auditor; +use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Control\Controller; use SilverStripe\Control\Email\Email; use SilverStripe\Core\Injector\Injector; use SilverStripe\ORM\DataExtension; @@ -16,6 +18,8 @@ /** * Provides logging hooks that are inserted into Framework objects. + * + * @extends DataExtension */ class AuditHook extends DataExtension { @@ -38,7 +42,6 @@ public static function handle_manipulation($manipulation) return false; } - /** @var DataObjectSchema $schema */ $schema = DataObject::getSchema(); // The tables that we watch for manipulation on diff --git a/code/AuditHookMFA.php b/code/AuditHookMFA.php index 96ac242..6beb793 100644 --- a/code/AuditHookMFA.php +++ b/code/AuditHookMFA.php @@ -4,12 +4,16 @@ use Psr\Log\LoggerInterface; use SilverStripe\Core\Injector\Injector; +use SilverStripe\MFA\Authenticator\LoginHandler; use SilverStripe\MFA\Method\MethodInterface; +use SilverStripe\MFA\Service\RegisteredMethodManager; use SilverStripe\ORM\DataExtension; use SilverStripe\Security\Member; /** * Provides logging actions on extension hooks from certain silverstripe/mfa actions. + * + * @extends DataExtension */ class AuditHookMFA extends DataExtension { diff --git a/code/AuditHookManyManyList.php b/code/AuditHookManyManyList.php index e36fde3..ae9a9c0 100644 --- a/code/AuditHookManyManyList.php +++ b/code/AuditHookManyManyList.php @@ -3,6 +3,7 @@ namespace SilverStripe\Auditor; use SilverStripe\Core\Injector\Injector; +use SilverStripe\ORM\DataObject; use SilverStripe\ORM\ManyManyList; use SilverStripe\Security\Group; use SilverStripe\Security\Member; @@ -11,6 +12,9 @@ /** * AuditHookManyManyList is meant to override ManyManyList. When a Member is * removed from a Group, it logs the event. + * + * @template T of DataObject + * @extends ManyManyList */ class AuditHookManyManyList extends ManyManyList { diff --git a/code/AuditHookSessionManager.php b/code/AuditHookSessionManager.php index 747f0fe..dc86795 100644 --- a/code/AuditHookSessionManager.php +++ b/code/AuditHookSessionManager.php @@ -6,10 +6,13 @@ use SilverStripe\Core\Injector\Injector; use SilverStripe\ORM\DataExtension; use SilverStripe\Security\Security; +use SilverStripe\SessionManager\Controllers\LoginSessionController; use SilverStripe\SessionManager\Models\LoginSession; /** * Provides logging actions on extension hooks from certain silverstripe/session-manager actions. + * + * @extends DataExtension */ class AuditHookSessionManager extends DataExtension { diff --git a/code/Extensions/ProxyDBExtension.php b/code/Extensions/ProxyDBExtension.php index c2c10a6..62d39da 100644 --- a/code/Extensions/ProxyDBExtension.php +++ b/code/Extensions/ProxyDBExtension.php @@ -5,7 +5,11 @@ use SilverStripe\Auditor\AuditHook; use SilverStripe\Core\Extension; use TractorCow\ClassProxy\Generators\ProxyGenerator; +use TractorCow\SilverStripeProxyDB\ProxyDBFactory; +/** + * @extends Extension + */ class ProxyDBExtension extends Extension { /**