Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Add generic types #67

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/AuditHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,6 +18,8 @@

/**
* Provides logging hooks that are inserted into Framework objects.
*
* @extends DataExtension<Member|SiteTree|Controller>
*/
class AuditHook extends DataExtension
{
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions code/AuditHookMFA.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<LoginHandler|RegisteredMethodManager>
*/
class AuditHookMFA extends DataExtension
{
Expand Down
4 changes: 4 additions & 0 deletions code/AuditHookManyManyList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<T>
*/
class AuditHookManyManyList extends ManyManyList
{
Expand Down
3 changes: 3 additions & 0 deletions code/AuditHookSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<LoginSessionController>
*/
class AuditHookSessionManager extends DataExtension
{
Expand Down
4 changes: 4 additions & 0 deletions code/Extensions/ProxyDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
use SilverStripe\Auditor\AuditHook;
use SilverStripe\Core\Extension;
use TractorCow\ClassProxy\Generators\ProxyGenerator;
use TractorCow\SilverStripeProxyDB\ProxyDBFactory;

/**
* @extends Extension<ProxyDBFactory>
*/
class ProxyDBExtension extends Extension
{
/**
Expand Down