mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Minor linting / style updates
This commit is contained in:
parent
8b429bf47b
commit
ee27329728
@ -4,13 +4,11 @@ namespace SilverStripe\Core\Cache;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a service that can flush its cache for a list of members
|
* Defines a service that can flush its cache for a list of members
|
||||||
* @package SilverStripe\Core\Cache
|
|
||||||
*/
|
*/
|
||||||
interface MemberCacheFlusher
|
interface MemberCacheFlusher
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param null $memberIDs
|
* @param array $memberIDs
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function flushMemberCache($memberIDs = null);
|
public function flushMemberCache($memberIDs = null);
|
||||||
}
|
}
|
@ -77,7 +77,7 @@ class InheritedPermissionFlusher extends DataExtension implements Flushable
|
|||||||
public function flushCache()
|
public function flushCache()
|
||||||
{
|
{
|
||||||
$ids = $this->getMemberIDList();
|
$ids = $this->getMemberIDList();
|
||||||
foreach ($this->services as $service) {
|
foreach ($this->getServices() as $service) {
|
||||||
$service->flushMemberCache($ids);
|
$service->flushMemberCache($ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,12 @@ namespace SilverStripe\Security\Tests;
|
|||||||
|
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
use SilverStripe\Core\Cache\CacheFactory;
|
use SilverStripe\Core\Cache\CacheFactory;
|
||||||
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
|
use SilverStripe\Security\Group;
|
||||||
use SilverStripe\Security\InheritedPermissionFlusher;
|
use SilverStripe\Security\InheritedPermissionFlusher;
|
||||||
use SilverStripe\Security\Member;
|
use SilverStripe\Security\Member;
|
||||||
use SilverStripe\Security\Group;
|
|
||||||
use SilverStripe\Core\Injector\Injector;
|
|
||||||
use SilverStripe\Security\Tests\InheritedPermissionsFlusherTest\TestCacheFlusher;
|
use SilverStripe\Security\Tests\InheritedPermissionsFlusherTest\TestCacheFlusher;
|
||||||
use SilverStripe\Core\Config\Config;
|
|
||||||
|
|
||||||
class InheritedPermissionsFlusherTest extends SapphireTest
|
class InheritedPermissionsFlusherTest extends SapphireTest
|
||||||
{
|
{
|
||||||
@ -59,7 +58,9 @@ class InheritedPermissionsFlusherTest extends SapphireTest
|
|||||||
$extension = new InheritedPermissionFlusher();
|
$extension = new InheritedPermissionFlusher();
|
||||||
$extension->setServices([$flusher]);
|
$extension->setServices([$flusher]);
|
||||||
Injector::inst()->registerService($extension, InheritedPermissionFlusher::class);
|
Injector::inst()->registerService($extension, InheritedPermissionFlusher::class);
|
||||||
|
/** @var Group $editors */
|
||||||
$editors = $this->objFromFixture(Group::class, 'editors');
|
$editors = $this->objFromFixture(Group::class, 'editors');
|
||||||
|
/** @var Group $admins */
|
||||||
$admins = $this->objFromFixture(Group::class, 'admins');
|
$admins = $this->objFromFixture(Group::class, 'admins');
|
||||||
|
|
||||||
// Populate the cache for all members in each group
|
// Populate the cache for all members in each group
|
||||||
|
@ -32,6 +32,7 @@ class TestCacheFlusher implements MemberCacheFlusher
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the cache for this instance only
|
* Clear the cache for this instance only
|
||||||
|
*
|
||||||
* @param array $memberIDs A list of member IDs
|
* @param array $memberIDs A list of member IDs
|
||||||
*/
|
*/
|
||||||
public function flushMemberCache($memberIDs = null)
|
public function flushMemberCache($memberIDs = null)
|
||||||
|
Loading…
Reference in New Issue
Block a user