Skip to content

Commit

Permalink
ENH Add generic types
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 11, 2024
1 parent 9e7054e commit 25cfbb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Extension/MemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
namespace SilverStripe\RealMe\Extension;

use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Member;

/**
* Class MemberExtension
* @extends DataExtension<Member>
*/
class MemberExtension extends DataExtension
{
Expand Down
6 changes: 5 additions & 1 deletion src/Extension/SiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace SilverStripe\RealMe\Extension;

use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\RealMe\RealMeService;
use SilverStripe\Security\InheritedPermissions;
use SilverStripe\Security\Member;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataExtension;

/**
* @extends DataExtension<SiteTree>
*/
class SiteTreeExtension extends DataExtension
{
private static $dependencies = array(
Expand Down Expand Up @@ -37,7 +41,7 @@ public function canView($member)
if ($member && $member->ID) {
return null;
}

$data = $this->service->getUserData();
if (empty($data)) {
// Defer if there's no logged in RealMe user
Expand Down

0 comments on commit 25cfbb2

Please sign in to comment.