No need for !!

This commit is contained in:
djmaze 2021-12-24 09:47:16 +01:00
parent e434d51157
commit 813bed72ad
9 changed files with 12 additions and 14 deletions

View file

@ -346,7 +346,7 @@ class Http
CURLOPT_FAILONERROR => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => !!$bFollowLocation,
CURLOPT_FOLLOWLOCATION => $bFollowLocation,
CURLOPT_MAXREDIRS => 7,
CURLOPT_FILE => $rFile,
CURLOPT_TIMEOUT => (int) $iTimeout

View file

@ -140,13 +140,13 @@ abstract class Driver
public function WriteOnErrorOnly(bool $bValue) : self
{
$this->bWriteOnErrorOnly = !!$bValue;
$this->bWriteOnErrorOnly = $bValue;
return $this;
}
public function WriteOnPhpErrorOnly(bool $bValue) : self
{
$this->bWriteOnPhpErrorOnly = !!$bValue;
$this->bWriteOnPhpErrorOnly = $bValue;
return $this;
}

View file

@ -167,14 +167,12 @@ abstract class NetClient
$this->writeLog('Start connection to "'.$this->sConnectedHost.':'.$this->iConnectedPort.'"',
\MailSo\Log\Enumerations\Type::NOTE);
$bVerifySsl = !!$bVerifySsl;
$bAllowSelfSigned = $bVerifySsl ? !!$bAllowSelfSigned : true;
$aStreamContextSettings = array(
'ssl' => array(
'verify_host' => $bVerifySsl,
'verify_peer' => $bVerifySsl,
'verify_peer_name' => $bVerifySsl,
'allow_self_signed' => $bAllowSelfSigned
'allow_self_signed' => $bVerifySsl ? $bAllowSelfSigned : true
)
);

View file

@ -141,7 +141,7 @@ class Actions
}
$this->oLogger = \MailSo\Log\Logger::SingletonInstance();
if (!!$this->oConfig->Get('logs', 'enable', false)) {
if ($this->oConfig->Get('logs', 'enable', false)) {
$sSessionFilter = (string)$this->oConfig->Get('logs', 'session_filter', '');
if (!empty($sSessionFilter)) {
$aSessionParts = \explode(':', $sSessionFilter, 2);
@ -633,7 +633,7 @@ class Actions
if (null === $this->oLoggerAuth) {
$this->oLoggerAuth = new \MailSo\Log\Logger(false);
if (!!$this->oConfig->Get('logs', 'auth_logging', false)) {
if ($this->oConfig->Get('logs', 'auth_logging', false)) {
$sAuthLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName(
$this->oConfig->Get('logs', 'auth_logging_filename', ''));
@ -963,7 +963,7 @@ class Actions
$aResult['PluginsLink'] = './?/Plugins/0/' . ($bAdmin ? 'Admin' : 'User') . '/' . $sStaticCache . '/';
}
$bAppJsDebug = !!$this->oConfig->Get('labs', 'use_app_debug_js', false);
$bAppJsDebug = $this->oConfig->Get('labs', 'use_app_debug_js', false);
$aResult['StaticLibJsLink'] = $this->StaticPath('js/' . ($bAppJsDebug ? '' : 'min/') .
'libs' . ($bAppJsDebug ? '' : '.min') . '.js');

View file

@ -171,7 +171,7 @@ trait Response
$oAccount = $this->getAccountFromToken();
if (!$mResult['DateTimeStampInUTC'] || !!$this->Config()->Get('labs', 'date_from_headers', false)) {
if (!$mResult['DateTimeStampInUTC'] || $this->Config()->Get('labs', 'date_from_headers', false)) {
$iDateTimeStampInUTC = $mResponse->HeaderTimeStampInUTC();
if ($iDateTimeStampInUTC) {
$mResult['DateTimeStampInUTC'] = $iDateTimeStampInUTC;

View file

@ -35,7 +35,7 @@ trait UserAuth
if (false === \strpos($sEmail, '@')) {
$this->Logger()->Write('The email address "' . $sEmail . '" is not complete', \MailSo\Log\Enumerations\Type::INFO, 'LOGIN');
if (false === \strpos($sEmail, '@') && !!$this->Config()->Get('login', 'determine_user_domain', false)) {
if (false === \strpos($sEmail, '@') && $this->Config()->Get('login', 'determine_user_domain', false)) {
$sUserHost = \trim($this->Http()->GetHost(false, true, true));
$this->Logger()->Write('Determined user domain: ' . $sUserHost, \MailSo\Log\Enumerations\Type::INFO, 'LOGIN');

View file

@ -140,7 +140,7 @@ class Identity implements \JsonSerializable
$this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : '';
$this->sSignature = !empty($aData['Signature']) ? $aData['Signature'] : '';
$this->bSignatureInsertBefore = isset($aData['SignatureInsertBefore']) ?
($bJson ? '1' === $aData['SignatureInsertBefore'] : !!$aData['SignatureInsertBefore']) : true;
!empty($aData['SignatureInsertBefore']) : true;
return true;
}

View file

@ -217,7 +217,7 @@ class Manager
{
if ($this->bIsEnabled && isset($aAppData['Plugins']) && \is_array($aAppData['Plugins']))
{
$bAuth = isset($aAppData['Auth']) && !!$aAppData['Auth'];
$bAuth = !empty($aAppData['Auth']);
foreach ($this->aPlugins as $oPlugin)
{
if ($oPlugin)

View file

@ -95,7 +95,7 @@ class Property
public function SetAllowedInJs(bool $bValue = true) : self
{
$this->bAllowedInJs = !!$bValue;
$this->bAllowedInJs = $bValue;
return $this;
}