Bugfixes and more conversions to PHP 7

This commit is contained in:
djmaze 2020-03-10 18:45:00 +01:00
parent 2cada68f41
commit 3a7ec4ecb0
100 changed files with 238 additions and 992 deletions

View file

@ -19,10 +19,8 @@ if (!\defined('RAINLOOP_APP_LIBRARIES_PATH'))
/**
* @param string $sClassName
*
* @return mixed
*/
function rainLoopSplAutoloadRegisterFunction($sClassName)
function rainLoopSplAutoloadRegisterFunction($sClassName) : void
{
if ($sClassName && '\\' === $sClassName[0])
{
@ -39,11 +37,10 @@ if (!\defined('RAINLOOP_APP_LIBRARIES_PATH'))
$sPrefix = 'Mobile_Detect/namespaced/';
}
return include RAINLOOP_APP_LIBRARIES_PATH.$sPrefix.\strtr($sClassName, '\\', '/').'.php';
include RAINLOOP_APP_LIBRARIES_PATH.$sPrefix.\strtr($sClassName, '\\', '/').'.php';
break;
}
}
return false;
}
\spl_autoload_register('rainLoopSplAutoloadRegisterFunction', false);

View file

@ -33,9 +33,8 @@ abstract class Collection
/**
* @param mixed $mItem
* @param bool $bToTop = false
* @return self
*/
public function Add($mItem, $bToTop = false)
public function Add($mItem, $bToTop = false) : self
{
if ($bToTop)
{
@ -51,11 +50,9 @@ abstract class Collection
/**
* @param array $aItems
* @return self
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function AddArray($aItems)
public function AddArray($aItems) : self
{
if (!\is_array($aItems))
{
@ -70,14 +67,9 @@ abstract class Collection
return $this;
}
/**
* @return self
*/
public function Clear()
public function Clear() : void
{
$this->aItems = array();
return $this;
}
/**
@ -88,10 +80,7 @@ abstract class Collection
return $this->aItems;
}
/**
* @return int
*/
public function Count()
public function Count() : int
{
return \count($this->aItems);
}
@ -144,9 +133,8 @@ abstract class Collection
/**
* @param mixed $mCallback
* @return void
*/
public function ForeachList($mCallback)
public function ForeachList($mCallback) : void
{
if (\is_callable($mCallback))
{
@ -174,8 +162,6 @@ abstract class Collection
/**
* @param array $aItems
* @return self
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetAsArray($aItems)
@ -186,7 +172,5 @@ abstract class Collection
}
$this->aItems = $aItems;
return $this;
}
}

View file

@ -18,12 +18,7 @@ namespace MailSo\Base\Exceptions;
*/
class Exception extends \Exception
{
/**
* @param string $sMessage
* @param int $iCode
* @param \Exception|null $oPrevious
*/
public function __construct($sMessage = '', $iCode = 0, $oPrevious = null)
public function __construct(string $sMessage = '', int $iCode = 0, \Throwable $oPrevious = null)
{
$sMessage = 0 === strlen($sMessage) ? str_replace('\\', '-', get_class($this)).' ('.
basename($this->getFile()).' ~ '.$this->getLine().')' : $sMessage;

View file

@ -744,10 +744,8 @@ class Http
/**
* @param int $iStatus
*
* @return void
*/
public function StatusHeader($iStatus, $sCustomStatusText = '')
public function StatusHeader($iStatus, $sCustomStatusText = '') : void
{
$iStatus = (int) $iStatus;
if (99 < $iStatus)

View file

@ -44,10 +44,8 @@ class Loader
/**
* @staticvar bool $bIsInited
*
* @return void
*/
public static function Init()
public static function Init() : void
{
static $bIsInited = false;
if (!$bIsInited)
@ -64,10 +62,8 @@ class Loader
/**
* @param string $sName
* @param int $iIncSize = 1
*
* @return void
*/
public static function IncStatistic($sName, $iIncSize = 1)
public static function IncStatistic($sName, $iIncSize = 1) : void
{
if (self::$StoreStatistic)
{
@ -79,10 +75,8 @@ class Loader
/**
* @param string $sName
* @param mixed $mValue
*
* @return void
*/
public static function SetStatistic($sName, $mValue)
public static function SetStatistic($sName, $mValue) : void
{
if (self::$StoreStatistic)
{

View file

@ -31,10 +31,8 @@ class ResourceRegistry
/**
* @staticvar bool $bInited
*
* @return void
*/
private static function regResourcesShutdownFunc()
private static function regResourcesShutdownFunc() : void
{
static $bInited = false;
if (!$bInited)
@ -98,10 +96,8 @@ class ResourceRegistry
/**
* @param resource $rResource
*
* @return void
*/
public static function CloseMemoryResource(&$rResource)
public static function CloseMemoryResource(&$rResource) : void
{
if (\is_resource($rResource))
{

View file

@ -17,30 +17,11 @@ namespace MailSo\Cache;
*/
interface DriverInterface
{
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool;
public function Set(string $sKey, string $sValue) : bool;
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey);
public function Get(string $sKey) : string;
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey);
public function Delete(string $sKey) : void;
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24);
public function GC(int $iTimeToClearInHours = 24) : bool;
}

View file

@ -23,12 +23,7 @@ class APC implements \MailSo\Cache\DriverInterface
*/
private $sKeyPrefix;
/**
* @access private
*
* @param string $sKeyPrefix = ''
*/
private function __construct($sKeyPrefix = '')
private function __construct(string $sKeyPrefix = '')
{
$this->sKeyPrefix = $sKeyPrefix;
if (!empty($this->sKeyPrefix))
@ -38,52 +33,28 @@ class APC implements \MailSo\Cache\DriverInterface
}
}
/**
* @param string $sKeyPrefix = ''
*
* @return \MailSo\Cache\Drivers\APC
*/
public static function NewInstance($sKeyPrefix = '')
public static function NewInstance(string $sKeyPrefix = '') : self
{
return new self($sKeyPrefix);
}
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool
public function Set(string $sKey, string $sValue) : bool
{
return \apc_store($this->generateCachedKey($sKey), (string) $sValue);
}
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey)
public function Get(string $sKey) : string
{
$sValue = \apc_fetch($this->generateCachedKey($sKey));
return \is_string($sValue) ? $sValue : '';
}
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey)
public function Delete(string $sKey) : void
{
\apc_delete($this->generateCachedKey($sKey));
}
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24)
public function GC(int $iTimeToClearInHours = 24) : bool
{
if (0 === $iTimeToClearInHours)
{
@ -93,12 +64,7 @@ class APC implements \MailSo\Cache\DriverInterface
return false;
}
/**
* @param string $sKey
*
* @return string
*/
private function generateCachedKey($sKey)
private function generateCachedKey(string $sKey) : string
{
return $this->sKeyPrefix.\sha1($sKey);
}

View file

@ -28,13 +28,7 @@ class File implements \MailSo\Cache\DriverInterface
*/
private $sKeyPrefix;
/**
* @access private
*
* @param string $sCacheFolder
* @param string $sKeyPrefix = ''
*/
private function __construct($sCacheFolder, $sKeyPrefix = '')
private function __construct(string $sCacheFolder, string $sKeyPrefix = '')
{
$this->sCacheFolder = $sCacheFolder;
$this->sCacheFolder = rtrim(trim($this->sCacheFolder), '\\/').'/';
@ -51,33 +45,18 @@ class File implements \MailSo\Cache\DriverInterface
}
}
/**
* @param string $sCacheFolder
* @param string $sKeyPrefix = ''
*
* @return \MailSo\Cache\Drivers\File
*/
public static function NewInstance($sCacheFolder, $sKeyPrefix = '')
public static function NewInstance(string $sCacheFolder, string $sKeyPrefix = '') : self
{
return new self($sCacheFolder, $sKeyPrefix);
}
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool
public function Set(string $sKey, string $sValue) : bool
{
$sPath = $this->generateCachedFileName($sKey, true);
return '' === $sPath ? false : false !== \file_put_contents($sPath, $sValue);
}
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey)
public function Get(string $sKey) : string
{
$sValue = '';
$sPath = $this->generateCachedFileName($sKey);
@ -89,12 +68,7 @@ class File implements \MailSo\Cache\DriverInterface
return \is_string($sValue) ? $sValue : '';
}
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey)
public function Delete(string $sKey) : void
{
$sPath = $this->generateCachedFileName($sKey);
if ('' !== $sPath && \file_exists($sPath))
@ -103,12 +77,7 @@ class File implements \MailSo\Cache\DriverInterface
}
}
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24)
public function GC(int $iTimeToClearInHours = 24) : bool
{
if (0 < $iTimeToClearInHours)
{
@ -119,13 +88,7 @@ class File implements \MailSo\Cache\DriverInterface
return false;
}
/**
* @param string $sKey
* @param bool $bMkDir = false
*
* @return string
*/
private function generateCachedFileName($sKey, $bMkDir = false)
private function generateCachedFileName(string $sKey, bool $bMkDir = false) : string
{
$sFilePath = '';
if (3 < \strlen($sKey))

View file

@ -43,13 +43,7 @@ class Memcache implements \MailSo\Cache\DriverInterface
*/
private $sKeyPrefix;
/**
* @param string $sHost = '127.0.0.1'
* @param int $iPost = 11211
* @param int $iExpire = 43200
* @param string $sKeyPrefix = ''
*/
private function __construct($sHost = '127.0.0.1', $iPost = 11211, $iExpire = 43200, $sKeyPrefix = '')
private function __construct(string $sHost = '127.0.0.1', int $iPost = 11211, int $iExpire = 43200, string $sKeyPrefix = '')
{
$this->sHost = $sHost;
$this->iPost = $iPost;
@ -69,45 +63,23 @@ class Memcache implements \MailSo\Cache\DriverInterface
}
}
/**
* @param string $sHost = '127.0.0.1'
* @param int $iPost = 11211
* @param int $iExpire = 43200
* @param string $sKeyPrefix = ''
*
* @return \MailSo\Cache\Drivers\APC
*/
public static function NewInstance($sHost = '127.0.0.1', $iPost = 11211, $iExpire = 43200, $sKeyPrefix = '')
public static function NewInstance(string $sHost = '127.0.0.1', int $iPost = 11211, int $iExpire = 43200, string $sKeyPrefix = '') : self
{
return new self($sHost, $iPost, $iExpire, $sKeyPrefix);
}
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool
public function Set(string $sKey, string $sValue) : bool
{
return $this->oMem ? $this->oMem->set($this->generateCachedKey($sKey), $sValue, 0, $this->iExpire) : false;
}
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey)
public function Get(string $sKey) : string
{
$sValue = $this->oMem ? $this->oMem->get($this->generateCachedKey($sKey)) : '';
return \is_string($sValue) ? $sValue : '';
}
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey)
public function Delete(string $sKey) : void
{
if ($this->oMem)
{
@ -115,12 +87,7 @@ class Memcache implements \MailSo\Cache\DriverInterface
}
}
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24)
public function GC(int $iTimeToClearInHours = 24) : bool
{
if (0 === $iTimeToClearInHours && $this->oMem)
{
@ -130,12 +97,7 @@ class Memcache implements \MailSo\Cache\DriverInterface
return false;
}
/**
* @param string $sKey
*
* @return string
*/
private function generateCachedKey($sKey)
private function generateCachedKey(string $sKey) : string
{
return $this->sKeyPrefix.\sha1($sKey);
}

View file

@ -43,13 +43,7 @@ class Redis implements \MailSo\Cache\DriverInterface
*/
private $sKeyPrefix;
/**
* @param string $sHost = '127.0.0.1'
* @param int $iPost = 6379
* @param int $iExpire = 43200
* @param string $sKeyPrefix = ''
*/
private function __construct($sHost = '127.0.0.1', $iPost = 6379, $iExpire = 43200, $sKeyPrefix = '')
private function __construct(string $sHost = '127.0.0.1', int $iPost = 6379, int $iExpire = 43200, string $sKeyPrefix = '')
{
$this->sHost = $sHost;
$this->iPost = $iPost;
@ -85,45 +79,23 @@ class Redis implements \MailSo\Cache\DriverInterface
}
}
/**
* @param string $sHost = '127.0.0.1'
* @param int $iPost = 11211
* @param int $iExpire = 43200
* @param string $sKeyPrefix = ''
*
* @return \MailSo\Cache\Drivers\APC
*/
public static function NewInstance($sHost = '127.0.0.1', $iPost = 6379, $iExpire = 43200, $sKeyPrefix = '')
public static function NewInstance(string $sHost = '127.0.0.1', int $iPost = 6379, int $iExpire = 43200, string $sKeyPrefix = '') : self
{
return new self($sHost, $iPost, $iExpire, $sKeyPrefix);
}
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool
public function Set(string $sKey, string $sValue) : bool
{
return $this->oRedis ? $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue) : false;
}
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey)
public function Get(string $sKey) : string
{
$sValue = $this->oRedis ? $this->oRedis->get($this->generateCachedKey($sKey)) : '';
return \is_string($sValue) ? $sValue : '';
}
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey)
public function Delete(string $sKey) : void
{
if ($this->oRedis)
{
@ -131,12 +103,7 @@ class Redis implements \MailSo\Cache\DriverInterface
}
}
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24)
public function GC(int $iTimeToClearInHours = 24) : bool
{
if (0 === $iTimeToClearInHours && $this->oRedis)
{
@ -146,12 +113,7 @@ class Redis implements \MailSo\Cache\DriverInterface
return false;
}
/**
* @param string $sKey
*
* @return string
*/
private function generateCachedKey($sKey)
private function generateCachedKey(string $sKey) : string
{
return $this->sKeyPrefix.\sha1($sKey);
}

View file

@ -23,13 +23,7 @@ class ResponseException extends \MailSo\Imap\Exceptions\Exception
*/
private $aResponses;
/**
* @param array $aResponses = array
* @param string $sMessage = ''
* @param int $iCode = 0
* @param \Exception $oPrevious = null
*/
public function __construct($aResponses = array(), $sMessage = '', $iCode = 0, $oPrevious = null)
public function __construct(array $aResponses = array(), string $sMessage = '', int $iCode = 0, ?\Throwable $oPrevious = null)
{
parent::__construct($sMessage, $iCode, $oPrevious);
@ -39,18 +33,12 @@ class ResponseException extends \MailSo\Imap\Exceptions\Exception
}
}
/**
* @return array
*/
public function GetResponses()
public function GetResponses() : array
{
return $this->aResponses;
}
/**
* @return \MailSo\Imap\Response|null
*/
public function GetLastResponse()
public function GetLastResponse() : ?Response
{
return 0 < count($this->aResponses) ? $this->aResponses[count($this->aResponses) - 1] : null;
}

View file

@ -27,32 +27,21 @@ class FetchResponse
*/
private $aEnvelopeCache;
/**
* @access private
*
* @param \MailSo\Imap\Response $oImapResponse
*/
private function __construct($oImapResponse)
private function __construct(Response $oImapResponse)
{
$this->oImapResponse = $oImapResponse;
$this->aEnvelopeCache = null;
}
/**
* @param \MailSo\Imap\Response $oImapResponse
* @return \MailSo\Imap\FetchResponse
*/
public static function NewInstance($oImapResponse)
public static function NewInstance(Response $oImapResponse) : self
{
return new self($oImapResponse);
}
/**
* @param bool $bForce = false
*
* @return array|null
*/
public function GetEnvelope($bForce = false)
public function GetEnvelope(bool $bForce = false)
{
if (null === $this->aEnvelopeCache || $bForce)
{
@ -62,23 +51,19 @@ class FetchResponse
}
/**
* @param int $iIndex
* @param mixed $mNullResult = null
*
* @return mixed
*/
public function GetFetchEnvelopeValue($iIndex, $mNullResult)
public function GetFetchEnvelopeValue(int $iIndex, $mNullResult)
{
return self::findEnvelopeIndex($this->GetEnvelope(), $iIndex, $mNullResult);
}
/**
* @param int $iIndex
* @param string $sParentCharset = \MailSo\Base\Enumerations\Charset::ISO_8859_1
*
* @return \MailSo\Mime\EmailCollection|null
*/
public function GetFetchEnvelopeEmailCollection($iIndex, $sParentCharset = \MailSo\Base\Enumerations\Charset::ISO_8859_1)
public function GetFetchEnvelopeEmailCollection(int $iIndex, string $sParentCharset = \MailSo\Base\Enumerations\Charset::ISO_8859_1)
{
$oResult = null;
$aEmails = $this->GetFetchEnvelopeValue($iIndex, null);
@ -112,11 +97,9 @@ class FetchResponse
}
/**
* @param string $sRfc822SubMimeIndex = ''
*
* @return \MailSo\Imap\BodyStructure|null
*/
public function GetFetchBodyStructure($sRfc822SubMimeIndex = '')
public function GetFetchBodyStructure(string $sRfc822SubMimeIndex = '')
{
$oBodyStructure = null;
$aBodyStructureArray = $this->GetFetchValue(Enumerations\FetchType::BODYSTRUCTURE);
@ -137,11 +120,9 @@ class FetchResponse
}
/**
* @param string $sFetchItemName
*
* @return mixed
*/
public function GetFetchValue($sFetchItemName)
public function GetFetchValue(string $sFetchItemName)
{
$mReturn = null;
$bNextIsValue = false;
@ -170,12 +151,7 @@ class FetchResponse
return $mReturn;
}
/**
* @param string $sRfc822SubMimeIndex = ''
*
* @return string
*/
public function GetHeaderFieldsValue($sRfc822SubMimeIndex = '')
public function GetHeaderFieldsValue(string $sRfc822SubMimeIndex = '') : string
{
$sReturn = '';
$bNextIsValue = false;
@ -227,12 +203,7 @@ class FetchResponse
return $bUid && $bSize;
}
/**
* @param \MailSo\Imap\Response $oImapResponse
*
* @return bool
*/
public static function IsValidFetchImapResponse($oImapResponse)
public static function IsValidFetchImapResponse(Response $oImapResponse) : bool
{
return (
$oImapResponse
@ -243,12 +214,7 @@ class FetchResponse
);
}
/**
* @param \MailSo\Imap\Response $oImapResponse
*
* @return bool
*/
public static function IsNotEmptyFetchImapResponse($oImapResponse)
public static function IsNotEmptyFetchImapResponse(Response $oImapResponse) : bool
{
return (
$oImapResponse
@ -259,13 +225,11 @@ class FetchResponse
}
/**
* @param array $aEnvelope
* @param int $iIndex
* @param mixed $mNullResult = null
*
* @return mixed
*/
private static function findEnvelopeIndex($aEnvelope, $iIndex, $mNullResult)
private static function findEnvelopeIndex(array $aEnvelope, int $iIndex, $mNullResult)
{
return (isset($aEnvelope[$iIndex]) && 'NIL' !== $aEnvelope[$iIndex] && '' !== $aEnvelope[$iIndex])
? $aEnvelope[$iIndex] : $mNullResult;

View file

@ -139,8 +139,6 @@ class ImapClient extends \MailSo\Net\NetClient
* @param bool $bAllowSelfSigned = true
* @param string $sClientCert = ''
*
* @return \MailSo\Imap\ImapClient
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Imap\Exceptions\Exception
@ -148,7 +146,7 @@ class ImapClient extends \MailSo\Net\NetClient
public function Connect($sServerName, $iPort = 143,
$iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT,
$bVerifySsl = false, $bAllowSelfSigned = true,
$sClientCert = '')
$sClientCert = '') : void
{
$this->aTagTimeouts['*'] = \microtime(true);
@ -170,8 +168,6 @@ class ImapClient extends \MailSo\Net\NetClient
new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'),
\MailSo\Log\Enumerations\Type::ERROR, true);
}
return $this;
}
protected function _xor($string, $string2)
@ -788,10 +784,8 @@ class ImapClient extends \MailSo\Net\NetClient
* @param array $aResult
* @param string $sFolderName
* @param bool $bIsWritable
*
* @return void
*/
protected function initCurrentFolderInformation($aResult, $sFolderName, $bIsWritable)
protected function initCurrentFolderInformation($aResult, $sFolderName, $bIsWritable) : void
{
if (\is_array($aResult))
{
@ -1895,10 +1889,8 @@ class ImapClient extends \MailSo\Net\NetClient
/**
* @param \MailSo\Imap\Response $oImapResponse
*
* @return void
*/
private function initCapabilityImapResponse($oImapResponse)
private function initCapabilityImapResponse($oImapResponse) : void
{
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType
&& \is_array($oImapResponse->ResponseList))
@ -2568,20 +2560,6 @@ class ImapClient extends \MailSo\Net\NetClient
return 'IMAP';
}
/**
* @param \MailSo\Log\Logger $oLogger
*
* @return \MailSo\Imap\ImapClient
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetLogger($oLogger)
{
parent::SetLogger($oLogger);
return $this;
}
/**
* @param resource $rConnect
* @param array $aCapabilityItems = array()

View file

@ -392,9 +392,8 @@ abstract class Driver
/**
* @final
* @return void
*/
final public function WriteEmptyLine()
final public function WriteEmptyLine() : void
{
if (!$this->bFlushCache && ($this->bWriteOnErrorOnly || $this->bWriteOnPhpErrorOnly || 0 < $this->iWriteOnTimeoutOnly))
{

View file

@ -250,10 +250,7 @@ class Logger extends \MailSo\Base\Collection
return !!(\MailSo\Log\Enumerations\Type::NOTICE === $iType && $this->bHideErrorNotices);
}
/**
* @return void
*/
public function __loggerShutDown()
public function __loggerShutDown() : void
{
if ($this->bUsed)
{

View file

@ -157,10 +157,8 @@ class FolderCollection extends \MailSo\Base\Collection
/**
* @param array $aUnsortedMailFolders
*
* @return void
*/
public function InitByUnsortedMailFolderArray($aUnsortedMailFolders)
public function InitByUnsortedMailFolderArray($aUnsortedMailFolders) : void
{
$this->Clear();
@ -256,10 +254,8 @@ class FolderCollection extends \MailSo\Base\Collection
/**
* @param callable $fCallback
*
* @return void
*/
public function SortByCallback($fCallback)
public function SortByCallback($fCallback) : void
{
if (\is_callable($fCallback))
{

View file

@ -711,11 +711,9 @@ class MailClient
* @param int $iUnseenCount
* @param string $sUidNext
* @param string $sHighestModSeq
*
* @return void
*/
protected function initFolderValues($sFolderName, &$iCount, &$iUnseenCount,
&$sUidNext, &$sHighestModSeq = '')
&$sUidNext, &$sHighestModSeq = '') : void
{
$aTypes = array(
\MailSo\Imap\Enumerations\FolderResponseStatus::MESSAGES,
@ -1850,7 +1848,7 @@ class MailClient
if (!\is_array($aResultUids))
{
$aResultUids = $bUseSortIfSupported ?
$this->oImapClient->MessageSimpleSort(array('REVERSE ARRIVAL'), $sSearchCriterias, true) :
$this->oImapClient->MessageSimpleSort(array('REVERSE DATE'), $sSearchCriterias, true) :
$this->oImapClient->MessageSimpleSearch($sSearchCriterias, true, \MailSo\Base\Utils::IsAscii($sSearchCriterias) ? '' : 'UTF-8')
;

View file

@ -95,10 +95,7 @@ class MessageCollection extends \MailSo\Base\Collection
return new self();
}
/**
* @return \MailSo\Mail\MessageCollection
*/
public function Clear()
public function Clear() : void
{
parent::Clear();
@ -117,7 +114,5 @@ class MessageCollection extends \MailSo\Base\Collection
$this->NewMessages = array();
$this->Filtered = false;
return $this;
}
}

View file

@ -66,10 +66,8 @@ class Header
* @param string $sName
* @param string $sValue
* @param string $sEncodedValueForReparse
*
* @return void
*/
private function initInputData($sName, $sValue, $sEncodedValueForReparse)
private function initInputData($sName, $sValue, $sEncodedValueForReparse) : void
{
$this->sName = trim($sName);
$this->sFullValue = trim($sValue);

View file

@ -211,19 +211,6 @@ class HeaderCollection extends \MailSo\Base\Collection
return $oResult;
}
/**
* @param array $aList
* @return \MailSo\Mime\HeaderCollection
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetAsArray($aList)
{
parent::SetAsArray($aList);
return $this;
}
/**
* @param string $sParentCharset
* @return \MailSo\Mime\HeaderCollection
@ -249,10 +236,7 @@ class HeaderCollection extends \MailSo\Base\Collection
return $this;
}
/**
* @return void
*/
public function Clear()
public function Clear() : void
{
parent::Clear();

View file

@ -97,20 +97,16 @@ class Message
/**
* @param string $sMessageId
*
* @return void
*/
public function SetMessageId($sMessageId)
public function SetMessageId($sMessageId) : void
{
$this->aHeadersValue[\MailSo\Mime\Enumerations\Header::MESSAGE_ID] = $sMessageId;
}
/**
* @param string $sHostName = ''
*
* @return void
*/
public function RegenerateMessageId($sHostName = '')
public function RegenerateMessageId($sHostName = '') : void
{
$this->SetMessageId($this->generateNewMessageId($sHostName));
}

View file

@ -52,20 +52,6 @@ class ParameterCollection extends \MailSo\Base\Collection
return $mResult;
}
/**
* @param array $aList
*
* @return \MailSo\Mime\ParameterCollection
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetAsArray($aList)
{
parent::SetAsArray($aList);
return $this;
}
/**
* @param string $sName
*
@ -131,10 +117,7 @@ class ParameterCollection extends \MailSo\Base\Collection
return 0 < \count($aResult) ? \implode('; ', $aResult) : '';
}
/**
* @return void
*/
private function reParseParameters()
private function reParseParameters() : void
{
$aDataToReParse = $this->CloneAsArray();
$sCharset = \MailSo\Base\Enumerations\Charset::UTF_8;

View file

@ -18,64 +18,31 @@ namespace MailSo\Mime\Parser;
*/
class ParserEmpty implements ParserInterface
{
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParse(\MailSo\Mime\Part &$oPart)
public function StartParse(\MailSo\Mime\Part $oPart) : void
{
}
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function EndParse(\MailSo\Mime\Part &$oPart)
public function EndParse(\MailSo\Mime\Part $oPart) : void
{
}
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void
{
}
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function EndParseMimePart(\MailSo\Mime\Part &$oPart)
public function EndParseMimePart(\MailSo\Mime\Part $oPart) : void
{
}
/**
* @return void
*/
public function InitMimePartHeader()
public function InitMimePartHeader() : void
{
}
/**
* @param string $sBuffer
*
* @return void
*/
public function ReadBuffer($sBuffer)
public function ReadBuffer(string $sBuffer) : void
{
}
/**
* @param string $sBuffer
*
* @return void
*/
public function WriteBody($sBuffer)
public function WriteBody(string $sBuffer) : void
{
}
}

View file

@ -18,49 +18,17 @@ namespace MailSo\Mime\Parser;
*/
interface ParserInterface
{
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParse(\MailSo\Mime\Part &$oPart);
public function StartParse(\MailSo\Mime\Part $oPart) : void;
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function EndParse(\MailSo\Mime\Part &$oPart);
public function EndParse(\MailSo\Mime\Part $oPart) : void;
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart);
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void;
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function EndParseMimePart(\MailSo\Mime\Part &$oPart);
public function EndParseMimePart(\MailSo\Mime\Part $oPart) : void;
/**
* @return void
*/
public function InitMimePartHeader();
public function InitMimePartHeader() : void;
/**
* @param string $sBuffer
*
* @return void
*/
public function ReadBuffer($sBuffer);
public function ReadBuffer(string $sBuffer) : void;
/**
* @param string $sBuffer
* @return void
*/
public function WriteBody($sBuffer);
public function WriteBody(string $sBuffer) : void;
}

View file

@ -23,22 +23,12 @@ class ParserMemory extends ParserEmpty implements ParserInterface
*/
protected $oCurrentMime = null;
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void
{
$this->oCurrentMime = $oPart;
}
/**
* @param string $sBuffer
*
* @return void
*/
public function WriteBody($sBuffer)
public function WriteBody(string $sBuffer) : void
{
if (null === $this->oCurrentMime->Body)
{

View file

@ -108,9 +108,6 @@ abstract class NetClient
$this->Clear();
}
/**
* @return void
*/
public function __destruct()
{
try
@ -127,10 +124,7 @@ abstract class NetClient
catch (\Exception $oException) {}
}
/**
* @return void
*/
public function Clear()
public function Clear() : void
{
$this->sResponseBuffer = '';
@ -141,32 +135,20 @@ abstract class NetClient
$this->bSecure = false;
}
/**
* @return string
*/
public function GetConnectedHost()
public function GetConnectedHost() : string
{
return $this->sConnectedHost;
}
/**
* @return int
*/
public function GetConnectedPort()
public function GetConnectedPort() : int
{
return $this->iConnectedPort;
}
/**
* @param int $iConnectTimeOut = 10
* @param int $iSocketTimeOut = 10
*
* @return void
*/
public function SetTimeOuts($iConnectTimeOut = 10, $iSocketTimeOut = 10)
public function SetTimeOuts(int $iConnectTimeOut = 10, int $iSocketTimeOut = 10) : void
{
$this->iConnectTimeOut = 5 < $iConnectTimeOut ? $iConnectTimeOut : 5;
$this->iSocketTimeOut = 5 < $iSocketTimeOut ? $iSocketTimeOut : 5;
$this->iConnectTimeOut = max(5, $iConnectTimeOut);
$this->iSocketTimeOut = max(5, $iSocketTimeOut);
}
/**
@ -198,8 +180,6 @@ abstract class NetClient
* @param bool $bAllowSelfSigned = true
* @param string $sClientCert = ''
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\SocketAlreadyConnectedException
* @throws \MailSo\Net\Exceptions\SocketCanNotConnectToHostException
@ -207,7 +187,7 @@ abstract class NetClient
public function Connect($sServerName, $iPort,
$iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT,
$bVerifySsl = false, $bAllowSelfSigned = true,
$sClientCert = '')
$sClientCert = '') : void
{
if (!\MailSo\Base\Validator::NotEmptyString($sServerName, true) || !\MailSo\Base\Validator::PortInt($iPort))
{
@ -340,10 +320,7 @@ abstract class NetClient
}
}
/**
* @return void
*/
public function Disconnect()
public function Disconnect() : void
{
if (\is_resource($this->rConnect))
{
@ -365,11 +342,9 @@ abstract class NetClient
}
/**
* @retun void
*
* @throws \MailSo\Net\Exceptions\Exception
*/
public function LogoutAndDisconnect()
public function LogoutAndDisconnect() : void
{
if (\method_exists($this, 'Logout') && !$this->bUnreadBuffer && !$this->bRunningCallback)
{
@ -398,11 +373,9 @@ abstract class NetClient
}
/**
* @return void
*
* @throws \MailSo\Net\Exceptions\SocketConnectionDoesNotAvailableException
*/
public function IsConnectedWithException()
public function IsConnectedWithException() : void
{
$this->IsConnected(true);
}
@ -421,12 +394,10 @@ abstract class NetClient
* @param bool $bWriteToLog = true
* @param string $sFakeRaw = ''
*
* @return void
*
* @throws \MailSo\Net\Exceptions\SocketConnectionDoesNotAvailableException
* @throws \MailSo\Net\Exceptions\SocketWriteException
*/
protected function sendRaw($sRaw, $bWriteToLog = true, $sFakeRaw = '')
protected function sendRaw($sRaw, $bWriteToLog = true, $sFakeRaw = '') : void
{
if ($this->bUnreadBuffer)
{
@ -473,12 +444,10 @@ abstract class NetClient
* @param mixed $mReadLen = null
* @param bool $bForceLogin = false
*
* @return void
*
* @throws \MailSo\Net\Exceptions\SocketConnectionDoesNotAvailableException
* @throws \MailSo\Net\Exceptions\SocketReadException
*/
protected function getNextBuffer($mReadLen = null, $bForceLogin = false)
protected function getNextBuffer($mReadLen = null, $bForceLogin = false) : void
{
if (null === $mReadLen)
{
@ -562,10 +531,8 @@ abstract class NetClient
/**
* @param string $sDesc
* @param int $iDescType = \MailSo\Log\Enumerations\Type::INFO
*
* @return void
*/
protected function writeLog($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO, $bDiplayCrLf = false)
protected function writeLog($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO, $bDiplayCrLf = false) : void
{
if ($this->oLogger)
{
@ -576,10 +543,8 @@ abstract class NetClient
/**
* @param string $sDesc
* @param int $iDescType = \MailSo\Log\Enumerations\Type::INFO
*
* @return void
*/
protected function writeLogWithCrlf($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO)
protected function writeLogWithCrlf($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO) : void
{
$this->writeLog($sDesc, $iDescType, true);
}
@ -588,11 +553,9 @@ abstract class NetClient
* @param \Exception $oException
* @param int $iDescType = \MailSo\Log\Enumerations\Type::NOTICE
* @param bool $bThrowException = false
*
* @return void
*/
protected function writeLogException($oException,
$iDescType = \MailSo\Log\Enumerations\Type::NOTICE, $bThrowException = false)
$iDescType = \MailSo\Log\Enumerations\Type::NOTICE, $bThrowException = false) : void
{
if ($this->oLogger)
{
@ -613,11 +576,9 @@ abstract class NetClient
/**
* @param \MailSo\Log\Logger $oLogger
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetLogger($oLogger)
public function SetLogger($oLogger) : void
{
if (!($oLogger instanceof \MailSo\Log\Logger))
{

View file

@ -105,15 +105,13 @@ class ManageSieveClient extends \MailSo\Net\NetClient
* @param bool $bVerifySsl = false
* @param bool $bAllowSelfSigned = true
*
* @return \MailSo\Sieve\ManageSieveClient
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Sieve\Exceptions\ResponseException
*/
public function Connect($sServerName, $iPort,
$iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT,
$bVerifySsl = false, $bAllowSelfSigned = true)
$bVerifySsl = false, $bAllowSelfSigned = true, $sClientCert = '') : void
{
$this->iRequestTime = \microtime(true);
@ -139,8 +137,6 @@ class ManageSieveClient extends \MailSo\Net\NetClient
new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'),
\MailSo\Log\Enumerations\Type::ERROR, true);
}
return $this;
}
/**
@ -478,12 +474,10 @@ class ManageSieveClient extends \MailSo\Net\NetClient
/**
* @param string $mResponse
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
*/
private function parseStartupResponse($mResponse)
private function parseStartupResponse($mResponse) : void
{
foreach ($mResponse as $sLine)
{
@ -515,12 +509,10 @@ class ManageSieveClient extends \MailSo\Net\NetClient
/**
* @param string $sRequest
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
*/
private function sendRequest($sRequest)
private function sendRequest($sRequest) : void
{
if (!\MailSo\Base\Validator::NotEmptyString($sRequest, true))
{
@ -537,13 +529,11 @@ class ManageSieveClient extends \MailSo\Net\NetClient
/**
* @param string $sRequest
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Sieve\Exceptions\NegativeResponseException
*/
private function sendRequestWithCheck($sRequest)
private function sendRequestWithCheck($sRequest) : void
{
$this->sendRequest($sRequest);
$this->validateResponse($this->parseResponse());
@ -637,17 +627,4 @@ class ManageSieveClient extends \MailSo\Net\NetClient
return 'SIEVE';
}
/**
* @param \MailSo\Log\Logger $oLogger
*
* @return \MailSo\Sieve\ManageSieveClient
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetLogger($oLogger)
{
parent::SetLogger($oLogger);
return $this;
}
}

View file

@ -153,15 +153,13 @@ class SmtpClient extends \MailSo\Net\NetClient
* @param bool $bVerifySsl = false
* @param bool $bAllowSelfSigned = true
*
* @return \MailSo\Smtp\SmtpClient
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Smtp\Exceptions\ResponseException
*/
public function Connect($sServerName, $iPort = 25, $sEhloHost = '[127.0.0.1]',
$iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT,
$bVerifySsl = false, $bAllowSelfSigned = true)
$bVerifySsl = false, $bAllowSelfSigned = true) : void
{
$this->iRequestTime = microtime(true);
@ -170,8 +168,6 @@ class SmtpClient extends \MailSo\Net\NetClient
$this->validateResponse(220);
$this->preLoginStartTLSAndEhloProcess($sEhloHost);
return $this;
}
/**
@ -556,10 +552,8 @@ class SmtpClient extends \MailSo\Net\NetClient
/**
* @param string $sEhloHost
*
* @return void
*/
private function preLoginStartTLSAndEhloProcess($sEhloHost)
private function preLoginStartTLSAndEhloProcess($sEhloHost) : void
{
if ($this->bHelo)
{
@ -593,12 +587,10 @@ class SmtpClient extends \MailSo\Net\NetClient
* @param string $sAddToCommand = ''
* @param bool $bSecureLog = false
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
*/
private function sendRequest($sCommand, $sAddToCommand = '', $bSecureLog = false)
private function sendRequest($sCommand, $sAddToCommand = '', $bSecureLog = false) : void
{
if (!\MailSo\Base\Validator::NotEmptyString($sCommand, true))
{
@ -616,8 +608,6 @@ class SmtpClient extends \MailSo\Net\NetClient
$this->iRequestTime = \microtime(true);
$this->sendRaw($sRealCommand, true, $sFakeCommand);
return $this;
}
/**
@ -627,13 +617,11 @@ class SmtpClient extends \MailSo\Net\NetClient
* @param bool $bSecureLog = false
* @param string $sErrorPrefix = ''
*
* @return void
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Smtp\Exceptions\Exception
*/
private function sendRequestWithCheck($sCommand, $mExpectCode, $sAddToCommand = '', $bSecureLog = false, $sErrorPrefix = '')
private function sendRequestWithCheck($sCommand, $mExpectCode, $sAddToCommand = '', $bSecureLog = false, $sErrorPrefix = '') : void
{
$this->sendRequest($sCommand, $sAddToCommand, $bSecureLog);
$this->validateResponse($mExpectCode, $sErrorPrefix);
@ -641,10 +629,8 @@ class SmtpClient extends \MailSo\Net\NetClient
/**
* @param string $sHost
*
* @return void
*/
private function ehloOrHelo($sHost)
private function ehloOrHelo($sHost) : void
{
try
{
@ -661,19 +647,15 @@ class SmtpClient extends \MailSo\Net\NetClient
throw $oException;
}
}
return $this;
}
/**
* @param string $sHost
*
* @return void
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Smtp\Exceptions\Exception
*/
private function ehlo($sHost)
private function ehlo($sHost) : void
{
$this->sendRequestWithCheck('EHLO', 250, $sHost);
@ -712,12 +694,10 @@ class SmtpClient extends \MailSo\Net\NetClient
/**
* @param string $sHost
*
* @return void
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Smtp\Exceptions\Exception
*/
private function helo($sHost)
private function helo($sHost) : void
{
$this->sendRequestWithCheck('HELO', 250, $sHost);
$this->aAuthTypes = array();
@ -729,11 +709,9 @@ class SmtpClient extends \MailSo\Net\NetClient
* @param int|array $mExpectCode
* @param string $sErrorPrefix = ''
*
* @return void
*
* @throws \MailSo\Smtp\Exceptions\ResponseException
*/
private function validateResponse($mExpectCode, $sErrorPrefix = '')
private function validateResponse($mExpectCode, $sErrorPrefix = '') : void
{
if (!\is_array($mExpectCode))
{
@ -787,17 +765,4 @@ class SmtpClient extends \MailSo\Net\NetClient
return 'SMTP';
}
/**
* @param \MailSo\Log\Logger $oLogger
*
* @return \MailSo\Smtp\SmtpClient
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public function SetLogger($oLogger)
{
parent::SetLogger($oLogger);
return $this;
}
}

View file

@ -3293,12 +3293,8 @@ class Net_IDNA2
*
* @param array $input UCS4 sequence
* @param boolean $include_bit Include bitmask in output
*
* @return void
* @static
* @access private
*/
private static function _showHex($input, $include_bit = false)
private static function _showHex($input, $include_bit = false) : void
{
foreach ($input as $k => $v) {
echo '[', $k, '] => ', sprintf('%X', $v);

View file

@ -106,11 +106,6 @@ class Actions
*/
private $oTwoFactorAuthProvider;
/**
* @var \RainLoop\Providers\Prem
*/
private $oPremProvider;
/**
* @var \RainLoop\Config\Application
*/
@ -151,7 +146,6 @@ class Actions
$this->oSuggestionsProvider = null;
$this->oChangePasswordProvider = null;
$this->oTwoFactorAuthProvider = null;
$this->oPremProvider = null;
$this->sSpecAuthToken = '';
$this->sUpdateAuthToken = '';
@ -343,10 +337,7 @@ class Actions
return $mResult;
}
/**
* @return void
*/
public function BootEnd()
public function BootEnd() : void
{
try
{
@ -547,10 +538,7 @@ class Actions
return $sFileName;
}
/**
* @return void
*/
public function SetAuthLogoutToken()
public function SetAuthLogoutToken() : void
{
@\header('X-RainLoop-Action: Logout');
\RainLoop\Utils::SetCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY, \md5(APP_START_TIME), 0);
@ -625,10 +613,7 @@ class Actions
\RainLoop\Utils::SetCookie(self::AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY, $sMessage, 0);
}
/**
* @return void
*/
private function setAdminAuthToken(string $sToken)
private function setAdminAuthToken(string $sToken) : void
{
\RainLoop\Utils::SetCookie(self::AUTH_ADMIN_TOKEN_KEY, $sToken, 0);
}
@ -644,10 +629,7 @@ class Actions
return \RainLoop\Utils::GetCookie(self::AUTH_ADMIN_TOKEN_KEY, '');
}
/**
* @return void
*/
public function ClearAdminAuthToken()
public function ClearAdminAuthToken() : void
{
$aAdminHash = \RainLoop\Utils::DecodeKeyValuesQ($this->getAdminAuthToken());
if (
@ -741,28 +723,6 @@ class Actions
return $this->oTwoFactorAuthProvider;
}
/**
* @return \RainLoop\Providers\Prem
*/
public function PremProvider()
{
if (null === $this->oPremProvider)
{
if (\file_exists(APP_VERSION_ROOT_PATH.'app/libraries/RainLoop/Providers/Prem.php'))
{
$this->oPremProvider = new \RainLoop\Providers\Prem(
$this->Config(), $this->Logger(), $this->Cacher(null, true)
);
}
else
{
$this->oPremProvider = false;
}
}
return $this->oPremProvider;
}
/**
* @return \RainLoop\Providers\Storage
*/
@ -1292,11 +1252,6 @@ class Actions
return $this->GetAccountFromCustomToken($this->getLocalAuthToken(), $bThrowExceptionOnFalse, true, true);
}
public function IsOpen() : bool
{
return !$this->PremProvider();
}
public function AppDataSystem(bool $bAdmin = false, bool $bMobile = false, bool $bMobileDevice = false) : array
{
$oConfig = $this->Config();
@ -1340,7 +1295,7 @@ class Actions
'themes' => $this->GetThemes($bMobile, false),
'languages' => $this->GetLanguages(false),
'languagesAdmin' => $this->GetLanguages(true),
'appVersionType' => APP_VERSION_TYPE,
'appVersionType' => 'community',
'attachmentsActions' => $aAttachmentsActions
), $bAdmin ? array(
'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
@ -1404,6 +1359,21 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
'Capa' => array(),
'Plugins' => array(),
'System' => $this->AppDataSystem($bAdmin, $bMobile, $bMobileDevice)
/*
'Community' => false,
'PremType' => true,
'LoginLogo' => $oConfig->Get('branding', 'login_logo', ''),
'LoginBackground' => $oConfig->Get('branding', 'login_background', ''),
'LoginCss' => $oConfig->Get('branding', 'login_css', ''),
'LoginDescription' => $oConfig->Get('branding', 'login_desc', ''),
'UserLogo' => $oConfig->Get('branding', 'user_logo', ''),
'UserLogoTitle' => $oConfig->Get('branding', 'user_logo_title', ''),
'UserLogoMessage' => $oConfig->Get('branding', 'user_logo_message', ''),
'UserIframeMessage' => $oConfig->Get('branding', 'user_iframe_message', ''),
'UserCss' => $oConfig->Get('branding', 'user_css', ''),
'WelcomePageUrl' => $oConfig->Get('branding', 'welcome_page_url', ''),
'WelcomePageDisplay' => \strtolower($oConfig->Get('branding', 'welcome_page_display', 'none')),
*/
);
if (0 < \strlen($sAuthAccountHash))
@ -1411,12 +1381,6 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$aResult['AuthAccountHash'] = $sAuthAccountHash;
}
$oPremProvider = $this->PremProvider();
if ($oPremProvider)
{
$oPremProvider->PopulateAppData($aResult);
}
if ('' !== $aResult['LoadingDescription'] && 'RainLoop' !== $aResult['LoadingDescription'])
{
$aResult['LoadingDescriptionEsc'] = @\htmlspecialchars($aResult['LoadingDescription'], ENT_QUOTES|ENT_IGNORE, 'UTF-8');
@ -3143,12 +3107,6 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$this->FilesProvider()->GC(48);
$this->Logger()->Write('Files GC: End');
}
else if ($bVersionsCache)
{
// if ($oPremProvider = $this->PremProvider()) {
// $oPremProvider->ClearOldVersion();
// }
}
$this->Plugins()->RunHook('service.app-delay-start-end');
@ -3340,10 +3298,25 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$this->setConfigFromParams($oConfig, 'TokenProtection', 'security', 'csrf_protection', 'bool');
$this->setConfigFromParams($oConfig, 'EnabledPlugins', 'plugins', 'enable', 'bool');
$oPremProvider = $this->PremProvider();
if ($oPremProvider)
if ($this && $this->HasOneOfActionParams(array(
'LoginLogo', 'LoginBackground', 'LoginDescription', 'LoginCss',
'UserLogo', 'UserLogoTitle', 'UserLogoMessage', 'UserIframeMessage', 'UserCss',
'WelcomePageUrl', 'WelcomePageDisplay'
)))
{
$oPremProvider->PremSection($this, $oConfig);
$this->setConfigFromParams($oConfig, 'LoginLogo', 'branding', 'login_logo', 'string');
$this->setConfigFromParams($oConfig, 'LoginBackground', 'branding', 'login_background', 'string');
$this->setConfigFromParams($oConfig, 'LoginDescription', 'branding', 'login_desc', 'string');
$this->setConfigFromParams($oConfig, 'LoginCss', 'branding', 'login_css', 'string');
$this->setConfigFromParams($oConfig, 'UserLogo', 'branding', 'user_logo', 'string');
$this->setConfigFromParams($oConfig, 'UserLogoTitle', 'branding', 'user_logo_title', 'string');
$this->setConfigFromParams($oConfig, 'UserLogoMessage', 'branding', 'user_logo_message', 'string');
$this->setConfigFromParams($oConfig, 'UserIframeMessage', 'branding', 'user_iframe_message', 'string');
$this->setConfigFromParams($oConfig, 'UserCss', 'branding', 'user_css', 'string');
$this->setConfigFromParams($oConfig, 'WelcomePageUrl', 'branding', 'welcome_page_url', 'string');
$this->setConfigFromParams($oConfig, 'WelcomePageDisplay', 'branding', 'welcome_page_display', 'string');
}
return $this->DefaultResponse(__FUNCTION__, $oConfig->Save());
@ -5258,10 +5231,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
return $oMessage;
}
/**
* @return void
*/
private function deleteMessageAttachmnets(\RainLoop\Model\Account $oAccount)
private function deleteMessageAttachmnets(\RainLoop\Model\Account $oAccount) : void
{
$aAttachments = $this->GetActionParam('Attachments', null);
@ -7339,10 +7309,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
return $bResult;
}
/**
* @return void
*/
public function verifyCacheByKey(string $sKey, bool $bForce = false)
public function verifyCacheByKey(string $sKey, bool $bForce = false) : void
{
if (!empty($sKey) && ($bForce || $this->Config()->Get('cache', 'enable', true) && $this->Config()->Get('cache', 'http', true)))
{
@ -8402,11 +8369,8 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
public function StaticPath(string $sPath) : string
{
$sKey = defined('APP_VERSION_TYPE') && 0 < strlen(APP_VERSION_TYPE) ? APP_VERSION_TYPE :
($this->IsOpen() ? 'community' : 'standard');
$sResult = \RainLoop\Utils::WebStaticPath().$sPath;
return $sResult.(false === \strpos($sResult, '?') ? '?' : '&').$sKey;
return $sResult.(false === \strpos($sResult, '?') ? '?' : '&').'community';
}
/**

View file

@ -4,9 +4,6 @@ namespace RainLoop;
class Api
{
/**
* @return void
*/
private function __construct()
{
}
@ -27,19 +24,16 @@ class Api
$bOne = \class_exists('MailSo\Version');
if ($bOne)
{
\RainLoop\Api::SetupDefaultMailSoConfig();
static::SetupDefaultMailSoConfig();
$bOne = \RainLoop\Api::RunResult();
$bOne = static::RunResult();
}
}
return $bOne;
}
/**
* @return \RainLoop\Actions
*/
public static function Actions()
public static function Actions() : Actions
{
static $oActions = null;
if (null === $oActions)
@ -51,11 +45,11 @@ class Api
}
/**
* @return \RainLoop\Application
* @return \RainLoop\Config\Application
*/
public static function Config()
{
return \RainLoop\Api::Actions()->Config();
return static::Actions()->Config();
}
/**
@ -63,49 +57,49 @@ class Api
*/
public static function Logger()
{
return \RainLoop\Api::Actions()->Logger();
return static::Actions()->Logger();
}
public static function SetupDefaultMailSoConfig() : string
protected static function SetupDefaultMailSoConfig() : void
{
if (\class_exists('MailSo\Config'))
{
if (\RainLoop\Api::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
if (static::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
\MailSo\Base\Utils::IsMbStringSupported() && \MailSo\Config::$MBSTRING)
{
\MailSo\Config::$ICONV = false;
}
\MailSo\Config::$MessageListFastSimpleSearch =
!!\RainLoop\Api::Config()->Get('labs', 'imap_message_list_fast_simple_search', true);
!!static::Config()->Get('labs', 'imap_message_list_fast_simple_search', true);
\MailSo\Config::$MessageListCountLimitTrigger =
(int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_count_limit_trigger', 0);
(int) static::Config()->Get('labs', 'imap_message_list_count_limit_trigger', 0);
\MailSo\Config::$MessageListDateFilter =
(int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_date_filter', 0);
(int) static::Config()->Get('labs', 'imap_message_list_date_filter', 0);
\MailSo\Config::$MessageListPermanentFilter =
\trim(\RainLoop\Api::Config()->Get('labs', 'imap_message_list_permanent_filter', ''));
\trim(static::Config()->Get('labs', 'imap_message_list_permanent_filter', ''));
\MailSo\Config::$MessageAllHeaders =
!!\RainLoop\Api::Config()->Get('labs', 'imap_message_all_headers', false);
!!static::Config()->Get('labs', 'imap_message_all_headers', false);
\MailSo\Config::$LargeThreadLimit =
(int) \RainLoop\Api::Config()->Get('labs', 'imap_large_thread_limit', 50);
(int) static::Config()->Get('labs', 'imap_large_thread_limit', 50);
\MailSo\Config::$ImapTimeout =
(int) \RainLoop\Api::Config()->Get('labs', 'imap_timeout', 300);
(int) static::Config()->Get('labs', 'imap_timeout', 300);
\MailSo\Config::$BoundaryPrefix = '_RainLoop_';
\MailSo\Config::$SystemLogger = \RainLoop\Api::Logger();
\MailSo\Config::$SystemLogger = static::Logger();
$sSslCafile = \RainLoop\Api::Config()->Get('ssl', 'cafile', '');
$sSslCapath = \RainLoop\Api::Config()->Get('ssl', 'capath', '');
$sSslCafile = static::Config()->Get('ssl', 'cafile', '');
$sSslCapath = static::Config()->Get('ssl', 'capath', '');
\RainLoop\Utils::$CookieDefaultPath = \RainLoop\Api::Config()->Get('labs', 'cookie_default_path', '');
if (\RainLoop\Api::Config()->Get('labs', 'cookie_default_secure', false))
\RainLoop\Utils::$CookieDefaultPath = static::Config()->Get('labs', 'cookie_default_path', '');
if (static::Config()->Get('labs', 'cookie_default_secure', false))
{
\RainLoop\Utils::$CookieDefaultSecure = true;
}
@ -128,11 +122,11 @@ class Api
});
}
\MailSo\Config::$HtmlStrictDebug = !!\RainLoop\Api::Config()->Get('debug', 'enable', false);
\MailSo\Config::$HtmlStrictDebug = !!static::Config()->Get('debug', 'enable', false);
\MailSo\Config::$CheckNewMessages = !!\RainLoop\Api::Config()->Get('labs', 'check_new_messages', true);
\MailSo\Config::$CheckNewMessages = !!static::Config()->Get('labs', 'check_new_messages', true);
if (\RainLoop\Api::Config()->Get('labs', 'strict_html_parser', true))
if (static::Config()->Get('labs', 'strict_html_parser', true))
{
\MailSo\Config::$HtmlStrictAllowedAttributes = array(
// rainloop
@ -178,7 +172,7 @@ class Api
}
}
public static function Version() : string
protected static function Version() : string
{
return APP_VERSION;
}
@ -187,7 +181,7 @@ class Api
{
$sSsoHash = \MailSo\Base\Utils::Sha1Rand(\md5($sEmail).\md5($sPassword));
return \RainLoop\Api::Actions()->Cacher()->Set(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash),
return static::Actions()->Cacher()->Set(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash),
\RainLoop\Utils::EncodeKeyValuesQ(array(
'Email' => $sEmail,
'Password' => $sPassword,
@ -198,7 +192,7 @@ class Api
public static function ClearUserSsoHash(string $sSsoHash) : bool
{
return \RainLoop\Api::Actions()->Cacher()->Delete(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash));
return static::Actions()->Cacher()->Delete(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash));
}
public static function ClearUserData(string $sEmail) : bool
@ -207,16 +201,16 @@ class Api
{
$sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail);
$oStorageProvider = \RainLoop\Api::Actions()->StorageProvider();
$oStorageProvider = static::Actions()->StorageProvider();
if ($oStorageProvider && $oStorageProvider->IsActive())
{
$oStorageProvider->DeleteStorage($sEmail);
}
if (\RainLoop\Api::Actions()->AddressBookProvider() &&
\RainLoop\Api::Actions()->AddressBookProvider()->IsActive())
if (static::Actions()->AddressBookProvider() &&
static::Actions()->AddressBookProvider()->IsActive())
{
\RainLoop\Api::Actions()->AddressBookProvider()->DeleteAllContacts($sEmail);
static::Actions()->AddressBookProvider()->DeleteAllContacts($sEmail);
}
return true;
@ -231,10 +225,7 @@ class Api
return true;
}
/**
* @return void
*/
public static function ExitOnEnd()
public static function ExitOnEnd() : void
{
if (!\defined('RAINLOOP_EXIT_ON_END'))
{

View file

@ -69,10 +69,8 @@ abstract class AbstractConfig
/**
* @param mixed $mParamValue
*
* @return void
*/
public function Set(string $sSectionKey, string $sParamKey, $mParamValue)
public function Set(string $sSectionKey, string $sParamKey, $mParamValue) : void
{
if (isset($this->aData[$sSectionKey][$sParamKey][0]))
{

View file

@ -6,9 +6,6 @@ class Application extends \RainLoop\Config\AbstractConfig
{
private $aReplaceEnv = null;
/**
* @return void
*/
public function __construct()
{
parent::__construct('application.ini',
@ -17,9 +14,9 @@ class Application extends \RainLoop\Config\AbstractConfig
defined('APP_ADDITIONAL_CONFIGURATION_NAME') ? APP_ADDITIONAL_CONFIGURATION_NAME : '');
}
public function Load()
public function Load() : bool
{
parent::Load();
$bResult = parent::Load();
$this->aReplaceEnv = null;
if ((isset($_ENV) && \is_array($_ENV) && 0 < \count($_ENV)) ||
@ -41,6 +38,8 @@ class Application extends \RainLoop\Config\AbstractConfig
{
$this->aReplaceEnv = null;
}
return $bResult;
}
/**
@ -84,7 +83,7 @@ class Application extends \RainLoop\Config\AbstractConfig
public function SetPassword(string $sPassword)
{
$this->Set('security', 'admin_password', \password_hash($sPassword));
$this->Set('security', 'admin_password', \password_hash($sPassword, PASSWORD_DEFAULT));
}
public function ValidatePassword(string $sPassword) : bool
@ -177,7 +176,7 @@ class Application extends \RainLoop\Config\AbstractConfig
'openpgp' => array(false),
'admin_login' => array('admin', 'Login and password for web admin panel'),
'admin_password' => array(\password_hash('12345')),
'admin_password' => array(\password_hash('12345', PASSWORD_DEFAULT)),
'allow_admin_panel' => array(true, 'Access settings'),
'allow_two_factor_auth' => array(false),
'force_two_factor_auth' => array(false),

View file

@ -18,14 +18,14 @@ class ClientException extends Exception
*/
private $sAdditionalMessage;
public function __construct(int $iCode, ?\Exception $oPrevious = null, string $sAdditionalMessage = '', bool $bLogoutOnException = false)
public function __construct(int $iCode, ?\Throwable $oPrevious = null, string $sAdditionalMessage = '', bool $bLogoutOnException = false)
{
parent::__construct(\RainLoop\Notifications::GetNotificationsMessage($iCode, $oPrevious),
$iCode, $oPrevious);
$this->sAdditionalMessage = $sAdditionalMessage;
$this->setLogoutOnException($bLogoutOnException);
$this->bLogoutOnException = $bLogoutOnException;
}
public function getAdditionalMessage() : string
@ -40,7 +40,7 @@ class ClientException extends Exception
public function setLogoutOnException(bool $bLogoutOnException, string $sAdditionalLogoutMessage = '') : self
{
$this->bLogoutOnException = !!$bLogoutOnException;
$this->bLogoutOnException = $bLogoutOnException;
$this->sAdditionalMessage = $sAdditionalLogoutMessage;

View file

@ -167,36 +167,24 @@ class Account
APP_SALT.$this->DomainIncPort().APP_SALT.$this->Password().APP_SALT.'0'.APP_SALT.$this->ParentEmail().APP_SALT);
}
/**
* @return void
*/
public function SetPassword(string $sPassword)
public function SetPassword(string $sPassword) : void
{
$this->sPassword = $sPassword;
}
/**
* @return void
*/
public function SetParentEmail(string $sParentEmail)
public function SetParentEmail(string $sParentEmail) : void
{
$this->sParentEmail = \trim(\MailSo\Base\Utils::IdnToAscii($sParentEmail, true));
}
/**
* @return void
*/
public function SetProxyAuthUser(string $sProxyAuthUser)
public function SetProxyAuthUser(string $sProxyAuthUser) : void
{
return $this->sProxyAuthUser = $sProxyAuthUser;
$this->sProxyAuthUser = $sProxyAuthUser;
}
/**
* @return void
*/
public function SetProxyAuthPassword(string $sProxyAuthPassword)
public function SetProxyAuthPassword(string $sProxyAuthPassword) : void
{
return $this->sProxyAuthPassword = $sProxyAuthPassword;
$this->sProxyAuthPassword = $sProxyAuthPassword;
}
public function DomainIncHost() : string
@ -293,7 +281,7 @@ class Account
/**
* @param \RainLoop\Plugins\Manager $oPlugins
* @param \MailSo\Mail\MailClient $oMailClient
* @param \RainLoop\Application $oConfig
* @param \RainLoop\Config\Application $oConfig
*/
public function IncConnectAndLoginHelper($oPlugins, $oMailClient, $oConfig, ?callback $refreshTokenCallback = null) : bool
{
@ -357,7 +345,7 @@ class Account
/**
* @param \RainLoop\Plugins\Manager $oPlugins
* @param \MailSo\Smtp\SmtpClient|null $oSmtpClient
* @param \RainLoop\Application $oConfig
* @param \RainLoop\Config\Application $oConfig
*/
public function OutConnectAndLoginHelper($oPlugins, $oSmtpClient, $oConfig, ?callback $refreshTokenCallback = null, bool &$bUsePhpMail = false) : bool
{
@ -413,7 +401,7 @@ class Account
/**
* @param \RainLoop\Plugins\Manager $oPlugins
* @param \MailSo\Sieve\ManageSieveClient $oSieveClient
* @param \RainLoop\Application $oConfig
* @param \RainLoop\Config\Application $oConfig
*/
public function SieveConnectAndLoginHelper($oPlugins, $oSieveClient, $oConfig)
{

View file

@ -39,9 +39,6 @@ class Identity
*/
private $bSignatureInsertBefore;
/**
* @return void
*/
protected function __construct(string $sId = '', string $sEmail = '')
{
$this->sId = empty($sId) ? '' : $sId;

View file

@ -24,9 +24,6 @@ class Template
*/
private $bPopulateAlways;
/**
* @return void
*/
protected function __construct(string $sId = '', string $sName = '', string $sBody = '')
{
$this->sId = $sId;

View file

@ -76,7 +76,7 @@ class Notifications
/**
* @staticvar array $aMap
*/
static public function GetNotificationsMessage(int $iCode, ?\Exception $oPrevious = null) : string
static public function GetNotificationsMessage(int $iCode, ?\Throwable $oPrevious = null) : string
{
static $aMap = array(
self::InvalidToken => 'InvalidToken',
@ -138,7 +138,7 @@ class Notifications
self::UnknownError => 'UnknownError'
);
if (self::ClientViewError === $iCode && $oPrevious instanceof \Exception)
if (self::ClientViewError === $iCode && $oPrevious instanceof \Throwable)
{
return $oPrevious->getMessage();
}

View file

@ -180,26 +180,17 @@ abstract class AbstractPlugin
return $this;
}
/**
* @return void
*/
public function PreInit()
public function PreInit() : void
{
}
/**
* @return void
*/
public function Init()
public function Init() : void
{
}
/**
* @return void
*/
public function FilterAppDataPluginSection(bool $bAdmin, bool $bAuth, array &$aConfig)
public function FilterAppDataPluginSection(bool $bAdmin, bool $bAuth, array &$aConfig) : void
{
}

View file

@ -4,9 +4,6 @@ namespace RainLoop\Plugins;
class Helper
{
/**
* @return void
*/
private function __construct()
{
}

View file

@ -238,7 +238,7 @@ class Manager
return '';
}
public function CompileTemplate(array &$aList, bool $bAdminScope = false) : string
public function CompileTemplate(array &$aList, bool $bAdminScope = false) : void
{
if ($this->bIsEnabled)
{
@ -612,10 +612,7 @@ class Manager
return $this;
}
/**
* @return void
*/
public function WriteLog(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO)
public function WriteLog(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO) : void
{
if ($this->oLogger)
{
@ -623,10 +620,7 @@ class Manager
}
}
/**
* @return void
*/
public function WriteException(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO)
public function WriteException(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO) : void
{
if ($this->oLogger)
{

View file

@ -11,9 +11,6 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
*/
private $oDriver;
/**
* @return void
*/
public function __construct(?\RainLoop\Providers\AddressBook\AddressBookInterface $oDriver)
{
$this->oDriver = $oDriver;

View file

@ -9,9 +9,6 @@ class Filters extends \RainLoop\Providers\AbstractProvider
*/
private $oDriver;
/**
* @return void
*/
public function __construct($oDriver)
{
$this->oDriver = $oDriver instanceof \RainLoop\Providers\Filters\FiltersInterface ? $oDriver : null;

View file

@ -20,7 +20,7 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
private $oPlugins;
/**
* @var \RainLoop\Application
* @var \RainLoop\Config\Application
*/
private $oConfig;
@ -29,9 +29,6 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
*/
private $bUtf8FolderName;
/**
* @return void
*/
public function __construct($oPlugins, $oConfig)
{
$this->oLogger = null;

View file

@ -1,66 +0,0 @@
<?php
namespace RainLoop\Providers;
class Prem
{
/**
* @return void
*/
public function __construct($oConfig, $oLogger, $oCacher)
{
$this->oConfig = $oConfig;
$this->oLogger = $oLogger;
$this->oCacher = $oCacher;
}
public function PopulateAppData(array &$aAppData)
{
if (\is_array($aAppData))
{
$aAppData['Community'] = false;
$oConfig = $this->oConfig;
if ($oConfig)
{
$aAppData['PremType'] = true;
$aAppData['LoginLogo'] = $oConfig->Get('branding', 'login_logo', '');
$aAppData['LoginBackground'] = $oConfig->Get('branding', 'login_background', '');
$aAppData['LoginCss'] = $oConfig->Get('branding', 'login_css', '');
$aAppData['LoginDescription'] = $oConfig->Get('branding', 'login_desc', '');
$aAppData['UserLogo'] = $oConfig->Get('branding', 'user_logo', '');
$aAppData['UserLogoTitle'] = $oConfig->Get('branding', 'user_logo_title', '');
$aAppData['UserLogoMessage'] = $oConfig->Get('branding', 'user_logo_message', '');
$aAppData['UserIframeMessage'] = $oConfig->Get('branding', 'user_iframe_message', '');
$aAppData['UserCss'] = $oConfig->Get('branding', 'user_css', '');
$aAppData['WelcomePageUrl'] = $oConfig->Get('branding', 'welcome_page_url', '');
$aAppData['WelcomePageDisplay'] = \strtolower($oConfig->Get('branding', 'welcome_page_display', 'none'));
}
}
}
public function PremSection(&$oActions, &$oConfig)
{
if ($oActions && $oActions->HasOneOfActionParams(array(
'LoginLogo', 'LoginBackground', 'LoginDescription', 'LoginCss',
'UserLogo', 'UserLogoTitle', 'UserLogoMessage', 'UserIframeMessage', 'UserCss',
'WelcomePageUrl', 'WelcomePageDisplay'
)))
{
$oActions->setConfigFromParams($oConfig, 'LoginLogo', 'branding', 'login_logo', 'string');
$oActions->setConfigFromParams($oConfig, 'LoginBackground', 'branding', 'login_background', 'string');
$oActions->setConfigFromParams($oConfig, 'LoginDescription', 'branding', 'login_desc', 'string');
$oActions->setConfigFromParams($oConfig, 'LoginCss', 'branding', 'login_css', 'string');
$oActions->setConfigFromParams($oConfig, 'UserLogo', 'branding', 'user_logo', 'string');
$oActions->setConfigFromParams($oConfig, 'UserLogoTitle', 'branding', 'user_logo_title', 'string');
$oActions->setConfigFromParams($oConfig, 'UserLogoMessage', 'branding', 'user_logo_message', 'string');
$oActions->setConfigFromParams($oConfig, 'UserIframeMessage', 'branding', 'user_iframe_message', 'string');
$oActions->setConfigFromParams($oConfig, 'UserCss', 'branding', 'user_css', 'string');
$oActions->setConfigFromParams($oConfig, 'WelcomePageUrl', 'branding', 'welcome_page_url', 'string');
$oActions->setConfigFromParams($oConfig, 'WelcomePageDisplay', 'branding', 'welcome_page_display', 'string');
}
}
}

View file

@ -11,8 +11,6 @@ class Settings extends \RainLoop\Providers\AbstractProvider
/**
* @param \RainLoop\Providers\Settings\ISettings $oDriver
*
* @return void
*/
public function __construct(\RainLoop\Providers\Settings\ISettings $oDriver)
{

View file

@ -9,9 +9,6 @@ class Storage extends \RainLoop\Providers\AbstractProvider
*/
private $oDriver;
/**
* @return void
*/
public function __construct(\RainLoop\Providers\Storage\IStorage $oDriver)
{
$this->oDriver = $oDriver;

View file

@ -19,9 +19,6 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
*/
protected $oLogger;
/**
* @return void
*/
public function __construct(string $sStoragePath, bool $bLocal = false)
{
$this->sDataPath = \rtrim(\trim($sStoragePath), '\\/');

View file

@ -8,7 +8,7 @@ interface IStorage
* @param \RainLoop\Model\Account|null $oAccount
* @param mixed $sValue
*/
public function Put($oAccount, int $iStorageType, int $sKey, $sValue) : bool;
public function Put($oAccount, int $iStorageType, string $sKey, $sValue) : bool;
/**
* @param \RainLoop\Model\Account|null $oAccount

View file

@ -11,8 +11,6 @@ class Suggestions extends \RainLoop\Providers\AbstractProvider
/**
* @param \RainLoop\Providers\Suggestions\ISuggestions[]|null $aDriver = null
*
* @return void
*/
public function __construct(?array $aDriver = null)
{

View file

@ -219,13 +219,7 @@ class Service
$sResult .= '<!--';
$sResult .= '[time:'.\substr(\microtime(true) - APP_START, 0, 6);
// $sResult .= '][version:'.APP_VERSION;
if ($this->oActions->IsOpen())
{
$sResult .= '][AGPLv3';
}
$sResult .= '][AGPLv3';
$sResult .= '][cached:'.($bCached ? 'true' : 'false');
// $sResult .= '][hash:'.$aTemplateParameters['{{BaseHash}}'];
// $sResult .= '][session:'.\md5(\RainLoop\Utils::GetShortToken());

View file

@ -49,7 +49,7 @@ class ServiceActions
}
/**
* @return \RainLoop\Application
* @return \RainLoop\Config\Application
*/
public function Config()
{

View file

@ -14,13 +14,10 @@ class Settings
*/
protected $bLocal;
/**
* @return void
*/
public function __construct(bool $bLocal = false)
{
$this->aData = array();
$this->bLocal = !!$bLocal;
$this->bLocal = $bLocal;
}
public function InitData(array $aData) : self
@ -55,10 +52,8 @@ class Settings
/**
* @param mixed $mValue
*
* @return void
*/
public function SetConf(string $sName, $mValue)
public function SetConf(string $sName, $mValue) : void
{
$this->aData[$sName] = $mValue;
}

View file

@ -220,10 +220,7 @@ class Utils
return \md5('Session'.APP_SALT.$sToken.'Token'.APP_SALT);
}
/**
* @return void
*/
static public function UpdateConnectionToken()
static public function UpdateConnectionToken() : void
{
$sKey = 'rltoken';
@ -256,10 +253,7 @@ class Utils
return $sResult;
}
/**
* @return void
*/
public static function ReadAndAddLang(string $sFileName, array &$aResultLang)
public static function ReadAndAddLang(string $sFileName, array &$aResultLang) : void
{
if (\file_exists($sFileName))
{

View file

@ -260,7 +260,7 @@ class PDO extends AbstractBackend {
$hasError = true;
$result[403][$propertyName] = null;
unset($mutations[$propertyName]);
continue;
break;
}
$fieldName = $this->propertyMap[$propertyName];

View file

@ -120,10 +120,10 @@ class ICSExportPlugin extends DAV\ServerPlugin {
// VTIMEZONE is special, because we need to filter out the duplicates
case 'VTIMEZONE' :
// Naively just checking tzid.
if (in_array((string)$child->TZID, $collectedTimezones)) continue;
$timezones[] = $child;
$collectedTimezones[] = $child->TZID;
if (!in_array((string)$child->TZID, $collectedTimezones)) {
$timezones[] = $child;
$collectedTimezones[] = $child->TZID;
}
break;
}

View file

@ -51,7 +51,7 @@ class VCalendar extends VObject\Document {
'DATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Date',
'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime',
'DURATION' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration',
'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Float',
'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Number',
'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer',
'PERIOD' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Period',
'RECUR' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur',
@ -80,7 +80,7 @@ class VCalendar extends VObject\Document {
'CLASS' => 'SabreForRainLoop\\VObject\\Property\\FlatText',
'COMMENT' => 'SabreForRainLoop\\VObject\\Property\\FlatText',
'DESCRIPTION' => 'SabreForRainLoop\\VObject\\Property\\FlatText',
'GEO' => 'SabreForRainLoop\\VObject\\Property\\Float',
'GEO' => 'SabreForRainLoop\\VObject\\Property\\Number',
'LOCATION' => 'SabreForRainLoop\\VObject\\Property\\FlatText',
'PERCENT-COMPLETE' => 'SabreForRainLoop\\VObject\\Property\\Integer',
'PRIORITY' => 'SabreForRainLoop\\VObject\\Property\\Integer',

View file

@ -45,7 +45,7 @@ class VCard extends VObject\Document {
'DATE' => 'SabreForRainLoop\\VObject\\Property\\VCard\\Date',
'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateTime',
'DATE-AND-OR-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', // vCard only
'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Float',
'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Number',
'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer',
'LANGUAGE-TAG' => 'SabreForRainLoop\\VObject\\Property\\VCard\\LanguageTag',
'TIMESTAMP' => 'SabreForRainLoop\\VObject\\Property\\VCard\\TimeStamp',

View file

@ -6,7 +6,7 @@ use
SabreForRainLoop\VObject\Property;
/**
* Float property
* Number property
*
* This object represents FLOAT values. These can be 1 or more floating-point
* numbers.
@ -15,7 +15,7 @@ use
* @author Evert Pot (http://evertpot.com/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Float extends Property {
class Number extends Property {
/**
* In case this is a multi-value property. This string will be used as a

View file

@ -1,66 +0,0 @@
<?php
/**
* Includes file
*
* This file includes the entire VObject library in one go.
* The benefit is that an autoloader is not needed, which is often faster.
*
* @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
// Begin includes
include __DIR__ . '/Cli.php';
include __DIR__ . '/DateTimeParser.php';
include __DIR__ . '/ElementList.php';
include __DIR__ . '/FreeBusyGenerator.php';
include __DIR__ . '/Node.php';
include __DIR__ . '/Parameter.php';
include __DIR__ . '/ParseException.php';
include __DIR__ . '/Parser/Parser.php';
include __DIR__ . '/Property.php';
include __DIR__ . '/Reader.php';
include __DIR__ . '/RecurrenceIterator.php';
include __DIR__ . '/Splitter/SplitterInterface.php';
include __DIR__ . '/Splitter/VCard.php';
include __DIR__ . '/StringUtil.php';
include __DIR__ . '/TimeZoneUtil.php';
include __DIR__ . '/VCardConverter.php';
include __DIR__ . '/Version.php';
include __DIR__ . '/Component.php';
include __DIR__ . '/Document.php';
include __DIR__ . '/EofException.php';
include __DIR__ . '/Parser/Json.php';
include __DIR__ . '/Parser/MimeDir.php';
include __DIR__ . '/Property/Binary.php';
include __DIR__ . '/Property/Boolean.php';
include __DIR__ . '/Property/Float.php';
include __DIR__ . '/Property/ICalendar/DateTime.php';
include __DIR__ . '/Property/ICalendar/Duration.php';
include __DIR__ . '/Property/ICalendar/Period.php';
include __DIR__ . '/Property/ICalendar/Recur.php';
include __DIR__ . '/Property/Integer.php';
include __DIR__ . '/Property/Text.php';
include __DIR__ . '/Property/Time.php';
include __DIR__ . '/Property/Unknown.php';
include __DIR__ . '/Property/Uri.php';
include __DIR__ . '/Property/UtcOffset.php';
include __DIR__ . '/Property/VCard/DateAndOrTime.php';
include __DIR__ . '/Property/VCard/DateTime.php';
include __DIR__ . '/Property/VCard/LanguageTag.php';
include __DIR__ . '/Property/VCard/TimeStamp.php';
include __DIR__ . '/Splitter/ICalendar.php';
include __DIR__ . '/Component/VAlarm.php';
include __DIR__ . '/Component/VCalendar.php';
include __DIR__ . '/Component/VCard.php';
include __DIR__ . '/Component/VEvent.php';
include __DIR__ . '/Component/VFreeBusy.php';
include __DIR__ . '/Component/VJournal.php';
include __DIR__ . '/Component/VTodo.php';
include __DIR__ . '/Property/FlatText.php';
include __DIR__ . '/Property/ICalendar/CalAddress.php';
include __DIR__ . '/Property/ICalendar/Date.php';
include __DIR__ . '/Property/VCard/Date.php';
// End includes

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB