Fix typehint

This commit is contained in:
Dennis Eichhorn 2017-01-25 11:44:56 +01:00
parent 6fd1ebe9b1
commit cfab6d9caf
4 changed files with 7 additions and 8 deletions

View File

@ -153,7 +153,7 @@ class Auth
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function logout(int $uid = null)
public function logout(int $uid = null) /* : void */
{
// TODO: logout other users? If admin wants to kick a user for updates etc.
$this->session->remove('UID');

View File

@ -42,7 +42,7 @@ interface CacheInterface
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function set($key, $value, int $expire = -1);
public function set($key, $value, int $expire = -1) /* : void */;
/**
* Adding new data if it doesn't exist.
@ -118,7 +118,7 @@ interface CacheInterface
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setStatus(int $status);
public function setStatus(int $status) /* : void */;
/**
* Updating existing value/key.

View File

@ -130,7 +130,7 @@ class CachePool implements OptionsInterface
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function create(string $key, array $config)
public function create(string $key, array $config) : bool
{
if (isset($this->pool[$key])) {
return false;

View File

@ -83,10 +83,8 @@ class FileCache implements CacheInterface
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct(array $config)
public function __construct(string $path)
{
$path = $config['path'] ?? '';
if (!File::exists($path)) {
Directory::create($path);
}
@ -111,7 +109,8 @@ class FileCache implements CacheInterface
/**
* {@inheritdoc}
*/
public function setStatus(int $status) {
public function setStatus(int $status) /* : void */
{
if(!CacheStatus::isValidValue($status)) {
throw new InvalidEnumValue($status);
}