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

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