Minor linting / style updates

This commit is contained in:
Damian Mooyman 2017-12-11 16:46:21 +13:00
parent 8b429bf47b
commit ee27329728
5 changed files with 12 additions and 12 deletions

View File

@ -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);
} }

View File

@ -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);
} }
} }

View File

@ -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

View File

@ -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)