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

API Replace Extension subclasses #879

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
4 changes: 2 additions & 2 deletions docs/en/scenarios.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ If you don't want to use the Filtered Locales Extension, then we can instead add
namespace MySite\Extension\SiteTree;
use SilverStripe\CMS\Model\SiteTreeExtension;
use SilverStripe\Core\Extension;
use SilverStripe\ORM\DataQuery;
use SilverStripe\ORM\Queries\SQLSelect;
use TractorCow\Fluent\State\FluentState;
Expand All @@ -122,7 +122,7 @@ use TractorCow\Fluent\Model\Locale;
* @property SiteTree|$this $owner
* @mixin FluentExtension
*/
class SiteTreeFluentExtension extends SiteTreeExtension
class SiteTreeFluentExtension extends Extension
{
/**
* @param SQLSelect $query
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/FluentChangesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace TractorCow\Fluent\Extension;

use SilverStripe\ORM\DataExtension;
use SilverStripe\Core\Extension;
use SilverStripe\Versioned\ChangeSetItem;

/**
* Adds locale-specific extensions to ChangeSet
*
* @extends DataExtension<ChangeSetItem>
* @extends Extension<ChangeSetItem>
*/
class FluentChangesExtension extends DataExtension
class FluentChangesExtension extends Extension
{
/**
* @see ChangeSetItem::getChangeType()
Expand Down
5 changes: 2 additions & 3 deletions src/Extension/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use SilverStripe\Forms\GridField\GridField_ActionMenuItem;
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataExtension;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataQuery;
use SilverStripe\ORM\DB;
Expand Down Expand Up @@ -48,9 +47,9 @@
* - data_include
*
* @template T of DataObject
* @extends DataExtension<T&static>
* @extends Extension<T&static>
*/
class FluentExtension extends DataExtension
class FluentExtension extends Extension
{
/**
* Deletions are managed via DeletePolicy
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/FluentFilteredExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Core\Extension;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataQuery;
use SilverStripe\ORM\ManyManyList;
Expand All @@ -19,9 +19,9 @@
/**
* @method ManyManyList<Locale> FilteredLocales()
*
* @extends DataExtension<DataObject&static>
* @extends Extension<DataObject&static>
*/
class FluentFilteredExtension extends DataExtension
class FluentFilteredExtension extends Extension
{
/**
* Deletions are managed via DeletePolicy
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/FluentIsolatedExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace TractorCow\Fluent\Extension;

use LogicException;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Core\Extension;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataQuery;
use SilverStripe\ORM\DB;
Expand All @@ -19,9 +19,9 @@
* @property int $LocaleID
* @method Locale Locale()
*
* @extends DataExtension<DataObject&static>
* @extends Extension<DataObject&static>
*/
class FluentIsolatedExtension extends DataExtension
class FluentIsolatedExtension extends Extension
{
private static $has_one = [
'Locale' => Locale::class,
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/FluentMemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace TractorCow\Fluent\Extension;

use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Core\Extension;
use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
use SilverStripe\Security\Member_GroupSet;
Expand All @@ -12,9 +12,9 @@
use TractorCow\Fluent\State\FluentState;

/**
* @extends DataExtension<Member>
* @extends Extension<Member>
*/
class FluentMemberExtension extends DataExtension
class FluentMemberExtension extends Extension
{
/**
* Update groups
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Extension/FluentSiteTreeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function setUp(): void
// Clear cache
Locale::clearCached();
Domain::clearCached();
(new FluentVersionedExtension)->flushCache();
FluentVersionedExtension::reset();

FluentState::singleton()
->setLocale('de_DE')
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Extension/FluentVersionedExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function setUp(): void
// Clear cache
Locale::clearCached();
Domain::clearCached();
(new FluentVersionedExtension)->flushCache();
FluentVersionedExtension::reset();

FluentState::singleton()
->setLocale('en_NZ')
Expand Down
Loading