diff --git a/rainloop/v/0.0.0/app/handle.php b/rainloop/v/0.0.0/app/handle.php index e4a32cba6..4af8498ef 100644 --- a/rainloop/v/0.0.0/app/handle.php +++ b/rainloop/v/0.0.0/app/handle.php @@ -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); diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Collection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Collection.php index 61dcbeb19..0718b75e2 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Collection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Collection.php @@ -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; } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Exceptions/Exception.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Exceptions/Exception.php index 95f540515..bca2940af 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Exceptions/Exception.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Exceptions/Exception.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php index cbb864c1d..393f2330c 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php @@ -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) diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Loader.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Loader.php index 0a58e5517..0a8cca846 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Loader.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Loader.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/ResourceRegistry.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/ResourceRegistry.php index 6e73ee791..b8118677f 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/ResourceRegistry.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/ResourceRegistry.php @@ -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)) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/DriverInterface.php b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/DriverInterface.php index baa2361e3..ae7fa478f 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/DriverInterface.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/DriverInterface.php @@ -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; } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/APC.php b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/APC.php index c8083b46b..9d7e78e78 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/APC.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/APC.php @@ -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); } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/File.php b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/File.php index 1f63aaea2..edab71be2 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/File.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/File.php @@ -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)) diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php index fe15c6206..eaa1d6074 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php @@ -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); } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php index e881a2992..e329d9882 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php @@ -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); } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/Exceptions/ResponseException.php b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/Exceptions/ResponseException.php index 24f0d8ca3..feee501ad 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/Exceptions/ResponseException.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/Exceptions/ResponseException.php @@ -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; } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/FetchResponse.php b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/FetchResponse.php index f9cbd74a0..d10221f63 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/FetchResponse.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/FetchResponse.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index 3688ddee7..ea24c7d2e 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -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() diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php index fd313fc28..9787c2654 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php @@ -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)) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php index 82cbf5418..2e337ef1e 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/FolderCollection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/FolderCollection.php index 9f0c00a0e..865ac1e9a 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/FolderCollection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/FolderCollection.php @@ -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)) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index 868721fbc..c9d29013e 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -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') ; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MessageCollection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MessageCollection.php index 427a18cac..c53298f70 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MessageCollection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MessageCollection.php @@ -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; } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Header.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Header.php index 188ed9da4..728b75023 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Header.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Header.php @@ -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); diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/HeaderCollection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/HeaderCollection.php index f5e36d462..5d29d8bd0 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/HeaderCollection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/HeaderCollection.php @@ -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(); diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php index 44dfa80b4..548c281f5 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php @@ -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)); } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/ParameterCollection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/ParameterCollection.php index 52b7dd375..0ee3e2458 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/ParameterCollection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/ParameterCollection.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserEmpty.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserEmpty.php index 2349ade75..1b9096715 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserEmpty.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserEmpty.php @@ -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 { } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserInterface.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserInterface.php index 8bf9ff648..b8bb103bb 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserInterface.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserInterface.php @@ -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; } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserMemory.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserMemory.php index c4269781b..07b08870a 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserMemory.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Parser/ParserMemory.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php index dfc9d2734..99e85e82c 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php @@ -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)) { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php index 77dd400f6..b0f81fd6c 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php @@ -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; - } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php index 8e94c1498..3bcd66568 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php @@ -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; - } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php b/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php index 820683411..baa83fb09 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php @@ -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); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 6f8227973..d79ca825d 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -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'; } /** diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Api.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Api.php index e2eec28a4..844261c78 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Api.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Api.php @@ -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')) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/AbstractConfig.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/AbstractConfig.php index 376fdba78..0c44e0852 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/AbstractConfig.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/AbstractConfig.php @@ -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])) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 9a3892715..1a205c54e 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -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), diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Exceptions/ClientException.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Exceptions/ClientException.php index 3f2d72ba9..354460e17 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Exceptions/ClientException.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Exceptions/ClientException.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Account.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Account.php index feb58f580..93a47ab33 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Account.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Account.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Identity.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Identity.php index 318ccabd2..2dc2493b4 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Identity.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Identity.php @@ -39,9 +39,6 @@ class Identity */ private $bSignatureInsertBefore; - /** - * @return void - */ protected function __construct(string $sId = '', string $sEmail = '') { $this->sId = empty($sId) ? '' : $sId; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Template.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Template.php index 46c346e47..d5117ee02 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Template.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Model/Template.php @@ -24,9 +24,6 @@ class Template */ private $bPopulateAlways; - /** - * @return void - */ protected function __construct(string $sId = '', string $sName = '', string $sBody = '') { $this->sId = $sId; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Notifications.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Notifications.php index 75855a2e3..d68368afb 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Notifications.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Notifications.php @@ -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(); } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/AbstractPlugin.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/AbstractPlugin.php index 7c87fbea7..3434e3cfc 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/AbstractPlugin.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/AbstractPlugin.php @@ -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 { } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Helper.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Helper.php index 6e57ec8af..e044431c7 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Helper.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Helper.php @@ -4,9 +4,6 @@ namespace RainLoop\Plugins; class Helper { - /** - * @return void - */ private function __construct() { } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php index 7a7de0233..03c72a0e5 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php index 5ec4d05cf..7e6618132 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters.php index 9d93fff55..206f8a749 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php index 84f2ce9e5..336eeaded 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php deleted file mode 100644 index cee7c52eb..000000000 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php +++ /dev/null @@ -1,66 +0,0 @@ -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'); - } - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php index cff77016b..e047a557f 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php index 194abebe0..76e98f23d 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php @@ -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; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php index ac0188c5e..0819d49a8 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php @@ -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), '\\/'); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/IStorage.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/IStorage.php index c55074f25..cd60920d8 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/IStorage.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Storage/IStorage.php @@ -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 diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Suggestions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Suggestions.php index e70ec0fcc..798ca5dc6 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Suggestions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Suggestions.php @@ -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) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php index 22764e0ea..b7a9885ab 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php @@ -219,13 +219,7 @@ class Service $sResult .= '