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 12, 2024
1 parent d7dcffe commit 8ebfc7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Extension/Engine/SiteTreePublishingEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* * action - name of the executed action: publish or unpublish
*
* @see PublishableSiteTree
*
* @extends DataExtension<SiteTree>
*/
class SiteTreePublishingEngine extends SiteTreeExtension implements Resettable
{
Expand Down Expand Up @@ -300,7 +302,6 @@ public function flushChanges()
$urlsToDelete = $this->getUrlsToDelete();

if ($urlsToUpdate) {
/** @var UrlBundleInterface $urlService */
$urlService = Injector::inst()->create(UrlBundleInterface::class);
$urlService->addUrls($urlsToUpdate);

Expand All @@ -314,7 +315,6 @@ public function flushChanges()
}

if ($urlsToDelete) {
/** @var UrlBundleInterface $urlService */
$urlService = Injector::inst()->create(UrlBundleInterface::class);
$urlService->addUrls($urlsToDelete);

Expand Down
6 changes: 4 additions & 2 deletions src/Extension/Publishable/PublishableSiteTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* an extension via the config system ordering (inject your extension "before" the PublishableSiteTree).
*
* @see SiteTreePublishingEngine
*
* @extends DataExtension<SiteTree>
*/
class PublishableSiteTree extends DataExtension implements StaticallyPublishable, StaticPublishingTrigger
{
Expand All @@ -36,7 +38,7 @@ public function getMyVirtualPages()
}

/**
* @return array|SS_List
* @return iterable<SiteTree>
*/
public function objectsToUpdate($context)
{
Expand Down Expand Up @@ -92,7 +94,7 @@ public function objectsToUpdate($context)
/**
* This method controls which caches will be purged
*
* @return array|SS_List
* @return iterable<SiteTree>
*/
public function objectsToDelete($context)
{
Expand Down

0 comments on commit 8ebfc7a

Please sign in to comment.