Skip to content

Commit

Permalink
[#13648] - More interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed May 15, 2019
1 parent b9fcaf7 commit e789f3c
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions phalcon/Firewall/Adapter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract class Adapter implements AdapterInterface, EventsAwareInterface
* Default access
* @var int
*/
protected defaultAccess = Acl::DENY { get, set };
protected defaultAccess = Acl::DENY { get };

/**
* Events manager
Expand Down Expand Up @@ -96,6 +96,30 @@ abstract class Adapter implements AdapterInterface, EventsAwareInterface
return this->alwaysResolvingRole;
}

/**
* Sets the cache adapter
*/
public function setCache(<CacheAdapterInterface> cache) -> <AdapterInterface>
{
let this->cache = cache;

if this->internalCache === null {
let this->internalCache = cache->get("_PHF_");
}

return this;
}

/**
* Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY)
*/
public function setDefaultAccess(int defaultAccess) -> <AdapterInterface>
{
let this->defaultAccess = defaultAccess;

return this;
}

/**
* Sets the events manager
*/
Expand Down Expand Up @@ -218,17 +242,6 @@ abstract class Adapter implements AdapterInterface, EventsAwareInterface
}
}

public function setCache(<CacheAdapterInterface> cache) -> <AdapterInterface>
{
let this->cache = cache;

if this->internalCache === null {
let this->internalCache = cache->get("_PHF_");
}

return this;
}

/**
* Throws an internal exception
*/
Expand Down

0 comments on commit e789f3c

Please sign in to comment.