Skip to content

Commit

Permalink
ENH Add generic types (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 18, 2024
1 parent bc5189b commit b78b1af
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Controllers/ShareDraftController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function preview(HTTPRequest $request)
->setSession(Injector::inst()->create(Session::class, []))
->getSession();
}
/** @var ShareToken $shareToken */
$shareToken = ShareToken::get()->filter('Token', $token)->first();

if (!$shareToken) {
Expand Down
4 changes: 4 additions & 0 deletions src/Extensions/ShareDraftContentControllerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

namespace SilverStripe\ShareDraftContent\Extensions;

use SilverStripe\Control\Controller;
use SilverStripe\Core\Extension;
use SilverStripe\Security\Security;

/**
* @extends Extension<Controller>
*/
class ShareDraftContentControllerExtension extends Extension
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use SilverStripe\Core\Extension;
use SilverStripe\ShareDraftContent\Controllers\ShareDraftController;

/**
* @extends Extension<FileShortcodeProvider>
*/
class ShareDraftContentFileShortcodeProviderExtension extends Extension
{
/**
Expand Down
4 changes: 4 additions & 0 deletions src/Extensions/ShareDraftContentRequirementsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

namespace SilverStripe\ShareDraftContent\Extensions;

use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\ORM\DataExtension;
use SilverStripe\View\Requirements;

/**
* @extends DataExtension<CMSMain>
*/
class ShareDraftContentRequirementsExtension extends DataExtension
{
public function init()
Expand Down
3 changes: 2 additions & 1 deletion src/Extensions/ShareDraftContentSiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
use SilverStripe\Subsites\Model\Subsite;

/**
* @property SiteTree|ShareDraftContentSiteTreeExtension $owner
* @property string $ShareTokenSalt
* @method HasManyList<ShareToken> ShareTokens()
*
* @extends DataExtension<SiteTree&static>
*/
class ShareDraftContentSiteTreeExtension extends DataExtension
{
Expand Down

0 comments on commit b78b1af

Please sign in to comment.