Compare commits

...

29 Commits

Author SHA1 Message Date
odain
fce1348d44 N°9104 - Be able to trigger cron remotely and asynchronously 2026-03-04 14:54:56 +01:00
odain
14d748aa97 rename cron scripts 2026-03-02 10:06:33 +01:00
odain
6f79e1842c ci : warum 2026-02-27 18:15:52 +01:00
odain
ecd4d77483 enable logs + ci debugging 2026-02-27 16:53:10 +01:00
odain
1a83149f14 ci test sdk: SaveItopConfFile method becomes protected 2026-02-27 16:28:43 +01:00
odain
828dbcf9b5 temp work 2026-02-27 09:40:08 +01:00
odain
e4b8f31af0 phpstan fix + add log 2026-02-26 08:46:06 +01:00
odain
393643b6f9 call cron asynchronously + tests 2026-02-25 17:28:15 +01:00
odain
259c82b88e temp 2026-02-24 17:04:03 +01:00
odain
0001f078c3 temp work 2026-02-24 17:04:02 +01:00
odain
a7ebf30746 be able to call cron locally/remotely via any authentication mode that implements iTokenLoginUIExtension (interface badly named) 2026-02-24 17:03:56 +01:00
odain
d92bdf7b89 new iTokenLoginUIExtension interface 2026-02-24 17:00:56 +01:00
odain
399f5bc449 cron endpoints behind login mechanism via auth_user and auth_pwd + deal with status_only different output 2026-02-24 17:00:56 +01:00
odain
d65412d61c be able to call cron asynchronously 2026-02-24 17:00:56 +01:00
Eric Espie
5201a1ed3b PHP CS fixer 2026-02-24 16:38:21 +01:00
odain
29920bfeb7 cleanup: log level in setUp + remove ls cli 2026-02-24 11:26:48 +01:00
Stephen Abello
aede5ea7b8 Fix CI by updating files code style 2026-02-23 16:25:08 +01:00
Stephen Abello
da6c443a35 Fix CI by updating files code style 2026-02-23 16:08:20 +01:00
Stephen Abello
9c39efd9af N°8549 - Update inline images secret (#815) 2026-02-23 15:42:21 +01:00
jf-cbd
d5f2303ed2 N°8673 - Avoid server overload when user access news page with a lot of unread news (#816) 2026-02-23 15:35:31 +01:00
Eric Espié
48e584503e N°8782 - Union queries allow all data (#807)
* 8782 - Union queries allow all data

* N°8782 - Union queries allow all data
2026-02-23 15:10:09 +01:00
Benjamin DALSASS
454a1b26eb N°8603 N°8601 - Remove unnecessary quotes in reload url injection 2026-02-23 10:22:10 +01:00
Benjamin Dalsass
330539abd2 N°8601 N°8603 dashboards issues (#813) 2026-02-23 06:51:40 +01:00
Stephen Abello
5357a0c060 Fix code style 2026-02-21 14:26:21 +01:00
lenaick.moreira
fc22cce037 N°8854 - Replace trigger_error() usage with E_USER_ERROR 2026-02-20 10:07:30 +01:00
lenaick.moreira
34c8a57814 N°8851 - Explicit nullable in functions parameters 2026-02-20 10:07:30 +01:00
Stephen Abello
2247691e58 Fix CI by updating files code style 2026-02-19 16:59:25 +01:00
Stephen Abello
076d49abc2 Dump autoloader 2026-02-19 16:15:58 +01:00
Stephen Abello
9fd0ffd84e N°8545 - Standardize return message from password reset (#812)
* N°8545 - Standardize return message from password reset

* N°8545 - Change log severity depending on the error source

* Add copyrights

* Update application/loginwebpage.class.inc.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update application/loginwebpage.class.inc.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Avoid using dictionary entries in logs

* Update application/loginwebpage.class.inc.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-19 16:12:34 +01:00
120 changed files with 1279 additions and 308 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* Login page extensibility
*
* @api
* @package UIExtensibilityAPI
* @since 3.x.x
*/
interface iTokenLoginUIExtension
{
/**
* @return array
* @api
*/
public function GetTokenInfo(): array;
/**
* @return array
* @api
*/
public function GetUserLogin(array $aTokenInfo): string;
}

View File

@@ -6037,7 +6037,7 @@ JS
* @return void
* @since 3.1.0
*/
final public function AddAttributeFlags(string $sAttCode, int $iFlags, string $sTargetState = '', string $sReason = null): void
final public function AddAttributeFlags(string $sAttCode, int $iFlags, string $sTargetState = '', ?string $sReason = null): void
{
if (!isset($this->aAttributesFlags[$sTargetState])) {
$this->aAttributesFlags[$sTargetState] = [];
@@ -6060,7 +6060,7 @@ JS
* @return void
* @since 3.1.0
*/
final public function ForceAttributeFlags(string $sAttCode, int $iFlags, string $sTargetState = '', string $sReason = null): void
final public function ForceAttributeFlags(string $sAttCode, int $iFlags, string $sTargetState = '', ?string $sReason = null): void
{
if (!isset($this->aAttributesFlags[$sTargetState])) {
$this->aAttributesFlags[$sTargetState] = [];
@@ -6101,7 +6101,7 @@ JS
* @return void
* @since 3.1.0
*/
final public function AddInitialAttributeFlags(string $sAttCode, int $iFlags, string $sReason = null)
final public function AddInitialAttributeFlags(string $sAttCode, int $iFlags, ?string $sReason = null)
{
if (!isset($this->aInitialAttributesFlags)) {
$this->aInitialAttributesFlags = [];
@@ -6123,7 +6123,7 @@ JS
* @return void
* @since 3.1.0
*/
final public function ForceInitialAttributeFlags(string $sAttCode, int $iFlags, string $sReason = null)
final public function ForceInitialAttributeFlags(string $sAttCode, int $iFlags, ?string $sReason = null)
{
if (!isset($this->aInitialAttributesFlags)) {
$this->aInitialAttributesFlags = [];

View File

@@ -1026,7 +1026,7 @@ EOF
var dashboard = $('.ibo-dashboard#$sDivId')
dashboard.block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'toggle_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, reload_url: '$sReloadURL' },
{ operation: 'toggle_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, reload_url: $sReloadURL },
function(data) {
dashboard.html(data);
dashboard.unblock();

View File

@@ -0,0 +1,10 @@
<?php
/**
* @copyright Copyright (C) 2010-2026 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ForgotPasswordApplicationException extends Exception
{
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @copyright Copyright (C) 2010-2026 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ForgotPasswordUserInputException extends Exception
{
}

View File

@@ -9,7 +9,7 @@ use Combodo\iTop\Application\Helper\Session;
* @license http://opensource.org/licenses/AGPL-3.0
*/
class LoginBasic extends AbstractLoginFSMExtension
class LoginBasic extends AbstractLoginFSMExtension implements iTokenLoginUIExtension
{
/**
* Return the list of supported login modes for this plugin
@@ -120,4 +120,20 @@ class LoginBasic extends AbstractLoginFSMExtension
}
return [$sAuthUser, $sAuthPwd];
}
public function GetTokenInfo(): array
{
return $this->GetAuthUserAndPassword();
}
public function GetUserLogin(array $aTokenInfo): string
{
$sLogin = $aTokenInfo[0];
$sLoginMode = 'basic';
if (UserRights::CheckCredentials($sLogin, $aTokenInfo[1], $sLoginMode, 'internal')) {
return $sLogin;
}
throw new Exception("Cannot CheckCredentials user login ($sLogin) with ($sLoginMode) mode");
}
}

View File

@@ -12,7 +12,7 @@ use Combodo\iTop\Application\Helper\Session;
*
* @since 2.7.0
*/
class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension, iTokenLoginUIExtension
{
private $bForceFormOnError = false;
@@ -32,8 +32,7 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
protected function OnReadCredentials(&$iErrorCode)
{
if (!Session::IsSet('login_mode') || Session::Get('login_mode') == 'form') {
$sAuthUser = utils::ReadPostedParam('auth_user', '', 'raw_data');
$sAuthPwd = utils::ReadPostedParam('auth_pwd', null, 'raw_data');
list($sAuthUser, $sAuthPwd) = $this->GetTokenInfo();
if ($this->bForceFormOnError || empty($sAuthUser) || empty($sAuthPwd)) {
if (array_key_exists('HTTP_X_COMBODO_AJAX', $_SERVER)) {
// X-Combodo-Ajax is a special header automatically added to all ajax requests
@@ -65,8 +64,7 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
protected function OnCheckCredentials(&$iErrorCode)
{
if (Session::Get('login_mode') == 'form') {
$sAuthUser = utils::ReadPostedParam('auth_user', '', 'raw_data');
$sAuthPwd = utils::ReadPostedParam('auth_pwd', null, 'raw_data');
list($sAuthUser, $sAuthPwd) = $this->GetTokenInfo();
if (!UserRights::CheckCredentials($sAuthUser, $sAuthPwd, Session::Get('login_mode'), 'internal')) {
$iErrorCode = LoginWebPage::EXIT_CODE_WRONGCREDENTIALS;
return LoginWebPage::LOGIN_FSM_ERROR;
@@ -145,4 +143,23 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension
return $oLoginContext;
}
public function GetTokenInfo(): array
{
$sAuthUser = utils::ReadPostedParam('auth_user', '', 'raw_data');
$sAuthPwd = utils::ReadPostedParam('auth_pwd', null, 'raw_data');
return [$sAuthUser, $sAuthPwd];
}
public function GetUserLogin(array $aTokenInfo): string
{
$sLogin = $aTokenInfo[0];
$sLoginMode = 'form';
if (UserRights::CheckCredentials($sLogin, $aTokenInfo[1], $sLoginMode, 'internal')) {
return $sLogin;
}
throw new Exception("Cannot CheckCredentials user login ($sLogin) with ($sLoginMode) mode");
}
}

View File

@@ -9,7 +9,7 @@ use Combodo\iTop\Application\Helper\Session;
* @license http://opensource.org/licenses/AGPL-3.0
*/
class LoginURL extends AbstractLoginFSMExtension
class LoginURL extends AbstractLoginFSMExtension implements iTokenLoginUIExtension
{
/**
* @var bool
@@ -29,9 +29,8 @@ class LoginURL extends AbstractLoginFSMExtension
protected function OnModeDetection(&$iErrorCode)
{
if (!Session::IsSet('login_mode') && !$this->bErrorOccurred) {
$sAuthUser = utils::ReadParam('auth_user', '', false, 'raw_data');
$sAuthPwd = utils::ReadParam('auth_pwd', null, false, 'raw_data');
if (!empty($sAuthUser) && !empty($sAuthPwd)) {
list($sAuthUser, $sAuthPwd) = $this->GetTokenInfo();
{
Session::Set('login_mode', 'url');
}
}
@@ -49,8 +48,7 @@ class LoginURL extends AbstractLoginFSMExtension
protected function OnCheckCredentials(&$iErrorCode)
{
if (Session::Get('login_mode') == 'url') {
$sAuthUser = utils::ReadParam('auth_user', '', false, 'raw_data');
$sAuthPwd = utils::ReadParam('auth_pwd', null, false, 'raw_data');
list($sAuthUser, $sAuthPwd) = $this->GetTokenInfo();
if (!UserRights::CheckCredentials($sAuthUser, $sAuthPwd, Session::Get('login_mode'), 'internal')) {
$iErrorCode = LoginWebPage::EXIT_CODE_WRONGCREDENTIALS;
return LoginWebPage::LOGIN_FSM_ERROR;
@@ -84,4 +82,22 @@ class LoginURL extends AbstractLoginFSMExtension
}
return LoginWebPage::LOGIN_FSM_CONTINUE;
}
public function GetTokenInfo(): array
{
$sAuthUser = utils::ReadParam('auth_user', '', false, 'raw_data');
$sAuthPwd = utils::ReadParam('auth_pwd', null, false, 'raw_data');
return [$sAuthUser, $sAuthPwd];
}
public function GetUserLogin(array $aTokenInfo): string
{
$sLogin = $aTokenInfo[0];
$sLoginMode = 'url';
if (UserRights::CheckCredentials($sLogin, $aTokenInfo[1], $sLoginMode, 'internal')) {
return $sLogin;
}
throw new Exception("Cannot CheckCredentials user login ($sLogin) with ($sLoginMode) mode");
}
}

View File

@@ -221,15 +221,15 @@ class LoginWebPage extends NiceWebPage
if ($oUser != null) {
if (!MetaModel::IsValidAttCode(get_class($oUser), 'reset_pwd_token')) {
throw new Exception(Dict::S('UI:ResetPwd-Error-NotPossible'));
throw new ForgotPasswordUserInputException('External accounts do not allow password reset');
}
if (!$oUser->CanChangePassword()) {
throw new Exception(Dict::S('UI:ResetPwd-Error-FixedPwd'));
throw new ForgotPasswordUserInputException('The account does not allow password reset');
}
$sTo = $oUser->GetResetPasswordEmail(); // throws Exceptions if not allowed
if ($sTo == '') {
throw new Exception(Dict::S('UI:ResetPwd-Error-NoEmail'));
throw new ForgotPasswordUserInputException('Missing email address for this account');
}
// This token allows the user to change the password without knowing the previous one
@@ -255,17 +255,21 @@ class LoginWebPage extends NiceWebPage
case EMAIL_SEND_ERROR:
default:
IssueLog::Error('Failed to send the email with the NEW password for '.$oUser->Get('friendlyname').': '.implode(', ', $aIssues));
throw new Exception(Dict::S('UI:ResetPwd-Error-Send'));
throw new ForgotPasswordApplicationException('Failed to send the password reset email for '.$oUser->Get('friendlyname').': '.implode(', ', $aIssues));
}
}
$oTwigContext = new LoginTwigRenderer();
$aVars = $oTwigContext->GetDefaultVars();
$oTwigContext->Render($this, 'forgotpwdsent.html.twig', $aVars);
} catch (Exception $e) {
$this->DisplayForgotPwdForm(true, $e->getMessage());
} catch (ForgotPasswordApplicationException $e) {
IssueLog::Error('Failed to process the forgot password request for user "'.$sAuthUser.'" [reason='.get_class($e).']: '.$e->getMessage());
} catch (ForgotPasswordUserInputException $e) {
IssueLog::Info('Failed to process the forgot password request for user "'.$sAuthUser.'" [reason='.get_class($e).']: '.$e->getMessage());
} catch (\Throwable $e) {
IssueLog::Error('Unexpected error while processing the forgot password request for user "'.$sAuthUser.'": '.$e->getMessage());
}
$oTwigContext = new LoginTwigRenderer();
$aVars = $oTwigContext->GetDefaultVars();
$oTwigContext->Render($this, 'forgotpwdsent.html.twig', $aVars);
}
public function DisplayResetPwdForm($sErrorMessage = null)
@@ -526,6 +530,23 @@ class LoginWebPage extends NiceWebPage
return $aPlugins;
}
public static function GetCurrentLoginPlugin(string $sCurrentLoginMode): iLoginExtension
{
/** @var iLoginExtension $oLoginExtensionInstance */
foreach (MetaModel::EnumPlugins('iLoginFSMExtension') as $oLoginExtensionInstance) {
$aLoginModes = $oLoginExtensionInstance->ListSupportedLoginModes();
$aLoginModes = (is_array($aLoginModes) ? $aLoginModes : []);
foreach ($aLoginModes as $sLoginMode) {
// Keep only the plugins for the current login mode + before + after
if ($sLoginMode == $sCurrentLoginMode) {
return $oLoginExtensionInstance;
}
}
}
throw new \Exception("should not happen");
}
/**
* Advance Login Finite State Machine to the next step
*

View File

@@ -34,7 +34,7 @@ interface iNewsroomProvider
* @param User $oUser The user for who to check if the provider is applicable.
* return bool
*/
public function IsApplicable(User $oUser = null);
public function IsApplicable(?User $oUser = null);
/**
* The human readable (localized) label for this provider
@@ -139,7 +139,7 @@ abstract class NewsroomProviderBase implements iNewsroomProvider
*/
abstract public function GetViewAllURL();
public function IsApplicable(User $oUser = null)
public function IsApplicable(?User $oUser = null)
{
return false;
}

View File

@@ -151,7 +151,7 @@ abstract class Query extends cmdbAbstractObject
* @return string|null
* @since 3.1.0
*/
abstract public function GetExportUrl(array $aValues = null): ?string;
abstract public function GetExportUrl(?array $aValues = null): ?string;
/**
* Update last export information.
@@ -227,7 +227,7 @@ class QueryOQL extends Query
}
/** @inheritdoc */
public function GetExportUrl(array $aValues = null): ?string
public function GetExportUrl(?array $aValues = null): ?string
{
try {
// retrieve attributes

View File

@@ -1284,7 +1284,7 @@ class utils
* @throws \CoreException
* @throws \Exception
*/
public static function ExecITopScript(string $sScriptName, array $aArguments, string $sAuthUser = null, string $sAuthPwd = null)
public static function ExecITopScript(string $sScriptName, array $aArguments, ?string $sAuthUser = null, ?string $sAuthPwd = null)
{
$aDisabled = explode(', ', ini_get('disable_functions'));
if (in_array('exec', $aDisabled)) {
@@ -1374,7 +1374,7 @@ class utils
* @return string A path to a folder into which any module can store cache data
* The corresponding folder is created or cleaned upon code compilation
*/
public static function GetCachePath(string $sEnvironment = null): string
public static function GetCachePath(?string $sEnvironment = null): string
{
if (is_null($sEnvironment)) {
$sEnvironment = MetaModel::GetEnvironment();
@@ -3226,4 +3226,43 @@ TXT
return $aTrace;
}
/**
* @author Ain Tohvri <https://mstdn.social/@tekkie>
*
* @since ???
*/
public static function ReadTail($sFilename, $iLines = 1): array
{
$handle = fopen($sFilename, "r");
if (false === $handle) {
throw new \Exception("Cannot read file $sFilename");
}
$iLineCounter = $iLines;
$iPos = -2;
$bBeginning = false;
$aLines = [];
while ($iLineCounter > 0) {
$sChar = " ";
while ($sChar != "\n") {
if (fseek($handle, $iPos, SEEK_END) == -1) {
$bBeginning = true;
break;
}
$sChar = fgetc($handle);
$iPos--;
}
$iLineCounter--;
if ($bBeginning) {
rewind($handle);
}
$aLines[$iLines - $iLineCounter - 1] = fgets($handle);
if ($bBeginning) {
break;
}
}
fclose($handle);
return array_reverse($aLines);
}
}

View File

@@ -912,7 +912,7 @@ abstract class AttributeDefinition
return call_user_func($sComputeFunc);
}
abstract public function GetDefaultValue(DBObject $oHostObject = null);
abstract public function GetDefaultValue(?DBObject $oHostObject = null);
//
// To be overloaded in subclasses
@@ -1476,7 +1476,7 @@ class AttributeDashboard extends AttributeDefinition
return "";
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
@@ -1622,7 +1622,7 @@ class AttributeLinkedSet extends AttributeDefinition
* @throws \CoreException
* @throws \CoreWarning
*/
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
if ($oHostObject === null) {
return null;
@@ -2639,7 +2639,7 @@ class AttributeDBFieldVoid extends AttributeDefinition
return $this->Get("sql");
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->MakeRealValue("", $oHostObject);
}
@@ -2728,7 +2728,7 @@ class AttributeDBField extends AttributeDBFieldVoid
return array_merge(parent::ListExpectedParams(), ["default_value", "is_null_allowed"]);
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->MakeRealValue($this->Get("default_value"), $oHostObject);
}
@@ -2917,7 +2917,7 @@ class AttributeObjectKey extends AttributeDBFieldVoid
return "INT(11)".($bFullSpec ? " DEFAULT 0" : "");
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return 0;
}
@@ -3649,7 +3649,7 @@ class AttributeClass extends AttributeString
parent::__construct($sCode, $aParams);
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$sDefault = parent::GetDefaultValue($oHostObject);
if (!$this->IsNullAllowed() && $this->IsNull($sDefault)) {
@@ -3843,7 +3843,7 @@ class AttributeFinalClass extends AttributeString
$this->m_sValue = $sValue;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->m_sValue;
}
@@ -4730,7 +4730,7 @@ class AttributeCaseLog extends AttributeLongText
}
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormCaseLog();
}
@@ -6128,7 +6128,7 @@ class AttributeDateTime extends AttributeDBField
return $iUnixSeconds;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$sDefaultValue = $this->Get('default_value');
if (utils::IsNotNullOrEmptyString($sDefaultValue)) {
@@ -6812,7 +6812,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
return $this->GetOptional('display_style', 'select');
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return 0;
}
@@ -7547,7 +7547,7 @@ class AttributeExternalField extends AttributeDefinition
return $oExtAttDef->GetSQLExpr();
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$oExtAttDef = $this->GetExtAttDef();
@@ -7910,12 +7910,12 @@ class AttributeBlob extends AttributeDefinition
return true;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormDocument('', '', '');
}
public function IsNullAllowed(DBObject $oHostObject = null)
public function IsNullAllowed(?DBObject $oHostObject = null)
{
return $this->GetOptional("is_null_allowed", false);
}
@@ -8295,7 +8295,7 @@ class AttributeImage extends AttributeBlob
return $oDoc;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormDocument('', '', '');
}
@@ -8481,7 +8481,7 @@ class AttributeStopWatch extends AttributeDefinition
return true;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->NewStopWatch();
}
@@ -9348,7 +9348,7 @@ class AttributeSubItem extends AttributeDefinition
return false;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
@@ -9566,7 +9566,7 @@ class AttributeOneWayPassword extends AttributeDefinition implements iAttributeN
return true;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return "";
}
@@ -10146,7 +10146,7 @@ abstract class AttributeSet extends AttributeDBFieldVoid
return true;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
@@ -11359,7 +11359,7 @@ class AttributeTagSet extends AttributeSet
return new ormTagSet(MetaModel::GetAttributeOrigin($this->GetHostClass(), $this->GetCode()), $this->GetCode(), $this->GetMaxItems());
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$oTagSet = new ormTagSet(MetaModel::GetAttributeOrigin($this->GetHostClass(), $this->GetCode()), $this->GetCode(), $this->GetMaxItems());
$oTagSet->SetValues([]);
@@ -11867,7 +11867,7 @@ class AttributeFriendlyName extends AttributeDefinition
$this->m_sValue = $sValue;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->m_sValue;
}
@@ -12030,7 +12030,7 @@ class AttributeRedundancySettings extends AttributeDBField
return 20;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$sRet = 'disabled';
if ($this->Get('enabled')) {
@@ -12466,7 +12466,7 @@ class AttributeCustomFields extends AttributeDefinition
return false;
} // See ReadValue...
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormCustomFieldsValue($oHostObject, $this->GetCode());
}
@@ -13053,7 +13053,7 @@ class AttributeObsolescenceFlag extends AttributeBoolean
return null;
}
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->MakeRealValue(false, $oHostObject);
}

View File

@@ -199,7 +199,7 @@ class CellStatus_SearchIssue extends CellStatus_Issue
* @param null $sAllowedValues : used for additional message that provides allowed values $sAllowedValues for current class
* @param string|null $sAllowedValuesSearch : used to search all allowed values
*/
public function __construct($sSerializedSearch, $sReason, $sClass = null, $sAllowedValues = null, string $sAllowedValuesSearch = null)
public function __construct($sSerializedSearch, $sReason, $sClass = null, $sAllowedValues = null, ?string $sAllowedValuesSearch = null)
{
parent::__construct(null, null, $sReason);
$this->sSerializedSearch = $sSerializedSearch;
@@ -873,7 +873,7 @@ class BulkChange
return $aResults;
}
protected function CreateObject(&$aResult, $iRow, $aRowData, CMDBChange $oChange = null)
protected function CreateObject(&$aResult, $iRow, $aRowData, ?CMDBChange $oChange = null)
{
$oTargetObj = MetaModel::NewObject($this->m_sClass);
@@ -962,7 +962,7 @@ class BulkChange
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
*/
protected function UpdateObject(&$aResult, $iRow, $oTargetObj, $aRowData, CMDBChange $oChange = null)
protected function UpdateObject(&$aResult, $iRow, $oTargetObj, $aRowData, ?CMDBChange $oChange = null)
{
$aResult[$iRow] = $this->PrepareObject($oTargetObj, $aRowData, $aErrors);
@@ -1005,7 +1005,7 @@ class BulkChange
*
* @throws \BulkChangeException
*/
protected function UpdateMissingObject(&$aResult, $iRow, $oTargetObj, CMDBChange $oChange = null)
protected function UpdateMissingObject(&$aResult, $iRow, $oTargetObj, ?CMDBChange $oChange = null)
{
$aResult[$iRow] = $this->PrepareMissingObject($oTargetObj, $aErrors);
@@ -1040,7 +1040,7 @@ class BulkChange
}
}
public function Process(CMDBChange $oChange = null)
public function Process(?CMDBChange $oChange = null)
{
if ($oChange) {
CMDBObject::SetCurrentChange($oChange);

View File

@@ -2569,7 +2569,7 @@ abstract class DBObject implements iDisplay
*
* @see \RestUtils::FindObjectFromKey for the same check in the REST endpoint
*/
final public function CheckChangedExtKeysValues(callable $oIsObjectLoadableCallback = null)
final public function CheckChangedExtKeysValues(?callable $oIsObjectLoadableCallback = null)
{
if (is_null($oIsObjectLoadableCallback)) {
$oIsObjectLoadableCallback = function ($sClass, $sId) {
@@ -3729,7 +3729,7 @@ abstract class DBObject implements iDisplay
* @throws \MySQLException
* @throws \OQLException
*/
private function ActivateOnObjectUpdateTriggers(?DBObject $oObject, array $aAttributes = null): void
private function ActivateOnObjectUpdateTriggers(?DBObject $oObject, ?array $aAttributes = null): void
{
if (is_null($oObject)) {
return;

View File

@@ -724,7 +724,7 @@ abstract class DBSearch
*
* @throws OQLException
*/
public static function FromOQL($sQuery, $aParams = null, ModelReflection $oMetaModel = null)
public static function FromOQL($sQuery, $aParams = null, ?ModelReflection $oMetaModel = null)
{
if (empty($sQuery)) {
return null;

View File

@@ -59,7 +59,7 @@ class DBUnionSearch extends DBSearch
public function AllowAllData($bAllowAllData = true)
{
foreach ($this->aSearches as $oSearch) {
$oSearch->AllowAllData();
$oSearch->AllowAllData($bAllowAllData);
}
}

View File

@@ -453,7 +453,7 @@ class DesignElement extends \DOMElement
* @throws Exception
* @since 3.1.2 3.2.0 N°6974
*/
public static function _FindNode(DOMNode $oParent, DesignElement $oRefNode, string $sSearchId = null): ?DesignElement
public static function _FindNode(DOMNode $oParent, DesignElement $oRefNode, ?string $sSearchId = null): ?DesignElement
{
$oNodes = self::_FindNodes($oParent, $oRefNode, $sSearchId);
if ($oNodes instanceof DOMNodeList) {
@@ -477,7 +477,7 @@ class DesignElement extends \DOMElement
* @return \DOMNodeList|false|mixed
* @since 3.1.2 3.2.0 N°6974
*/
public static function _FindNodes(DOMNode $oParent, DesignElement $oRefNode, string $sSearchId = null)
public static function _FindNodes(DOMNode $oParent, DesignElement $oRefNode, ?string $sSearchId = null)
{
if ($oParent instanceof DOMDocument) {
$oDoc = $oParent->firstChild->ownerDocument;

View File

@@ -632,7 +632,7 @@ class DisplayableGroupNode extends DisplayableNode
$this->aObjects = [];
}
public function AddObject(DBObject $oObj = null)
public function AddObject(?DBObject $oObj = null)
{
if (is_object($oObj)) {
$sPrevClass = $this->GetObjectClass();

View File

@@ -1656,7 +1656,7 @@ class PHP_ParserGenerator_Data
function emit_code($out, PHP_ParserGenerator_Rule $rp, &$lineno)
{
$linecnt = 0;
/* Generate code to do the reduce action */
if ($rp->code) {
$this->tplt_linedir($out, $rp->line, $this->filename);

View File

@@ -1094,7 +1094,7 @@ static public $yy_action = array(
function yy_find_shift_action($iLookAhead)
{
$stateno = $this->yystack[$this->yyidx]->stateno;
/* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
if (!isset(self::$yy_shift_ofst[$stateno])) {
// no shift actions
@@ -1781,7 +1781,7 @@ throw new OQLParserParseFailureException($this->m_sSourceQuery, $this->m_iLine,
function yy_syntax_error($yymajor, $TOKEN)
{
#line 25 "..\oql-parser.y"
throw new OQLParserSyntaxErrorException($this->m_sSourceQuery, $this->m_iLine, $this->m_iCol, $this->tokenName($yymajor), $TOKEN);
#line 1793 "..\oql-parser.php"
}
@@ -1820,7 +1820,7 @@ throw new OQLParserSyntaxErrorException($this->m_sSourceQuery, $this->m_iLine, $
// $yyact; /* The parser action. */
// $yyendofinput; /* True if we are at the end of input */
$yyerrorhit = 0; /* True if yymajor has invoked an error */
/* (re)initialize the parser, if necessary */
if ($this->yyidx === null || $this->yyidx < 0) {
/* if ($yymajor == 0) return; // not sure why this was here... */
@@ -1833,7 +1833,7 @@ throw new OQLParserSyntaxErrorException($this->m_sSourceQuery, $this->m_iLine, $
array_push($this->yystack, $x);
}
$yyendofinput = ($yymajor==0);
if (self::$yyTraceFILE) {
fprintf(
self::$yyTraceFILE,
@@ -1842,7 +1842,7 @@ throw new OQLParserSyntaxErrorException($this->m_sSourceQuery, $this->m_iLine, $
self::$yyTokenName[$yymajor]
);
}
do {
$yyact = $this->yy_find_shift_action($yymajor);
if ($yymajor < self::YYERRORSYMBOL
@@ -2016,7 +2016,7 @@ class OQLParser extends OQLParserRaw
$this->m_sSourceQuery = $sQuery;
// no constructor - parent::__construct();
}
public function doParse($token, $value, $iCurrPosition = 0)
{
$this->m_iColPrev = $this->m_iCol;
@@ -2030,7 +2030,7 @@ class OQLParser extends OQLParserRaw
$this->doParse(0, 0);
return $this->my_result;
}
public function __destruct()
{
// Bug in the original destructor, causing an infinite loop !

View File

@@ -370,7 +370,7 @@ class ormCaseLog
/**
* Produces an HTML representation, aimed at being used within the iTop framework
*/
public function GetAsHTML(WebPage $oP = null, $bEditMode = false, $aTransfoHandler = null)
public function GetAsHTML(?WebPage $oP = null, $bEditMode = false, $aTransfoHandler = null)
{
$bPrintableVersion = (utils::ReadParam('printable', '0') == '1');

View File

@@ -362,8 +362,7 @@ class ormDocument
throw new Exception("Invalid id ($id) for class '$sClass' - the object does not exist or you are not allowed to view it");
}
}
if (($sSecretField != null) && ($oObj->Get($sSecretField) != $sSecretValue)) {
usleep(200);
if (($sSecretField != null) && !hash_equals($oObj->Get($sSecretField), $sSecretValue)) {
throw new Exception("Invalid secret for class '$sClass' - the object does not exist or you are not allowed to view it");
}
/** @var \ormDocument $oDocument */

View File

@@ -93,7 +93,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
* @param DBObjectSet|null $oOriginalSet
* @throws Exception
*/
public function __construct($sHostClass, $sAttCode, DBObjectSet $oOriginalSet = null)
public function __construct($sHostClass, $sAttCode, ?DBObjectSet $oOriginalSet = null)
{
$this->sHostClass = $sHostClass;
$this->sAttCode = $sAttCode;

View File

@@ -72,9 +72,12 @@ $ibo-panel--icon--spacing--as-medallion--is-sticking: $ibo-panel--icon--spacing-
$ibo-panel--icon--bottom--as-medallion--is-sticking: -12px !default;
$ibo-panel--icon--border--as-medallion--is-sticking: 1px $ibo-panel--base-border-style $ibo-panel--base-border-color !default;
$ibo-panel--icon-background--size--must-contain: contain !default;
$ibo-panel--icon-background--size--must-cover: cover !default;
$ibo-panel--icon-background--size--must-zoomout: 66.67% !default;
$ibo-panel--icon-background--size--must-contain: contain !default; // deprecated, to be removed in favor of $ibo-panel--icon-img--size--must-contain
$ibo-panel--icon-background--size--must-cover: cover !default; // deprecated, to be removed in favor of $ibo-panel--icon-img--size--must-cover
$ibo-panel--icon-background--size--must-zoomout: 66.67% !default; // deprecated, to be removed in favor of $ibo-panel--icon-img--size--must-zoomout
$ibo-panel--icon-img--size--must-contain: $ibo-panel--icon-background--size--must-contain !default; // TODO remove when dealing with N°9317
$ibo-panel--icon-img--size--must-cover: $ibo-panel--icon-background--size--must-cover !default; // TODO remove when dealing with N°9317
$ibo-panel--icon-img--size--must-zoomout: $ibo-panel--icon-background--size--must-zoomout !default; // TODO remove when dealing with N°9317
$ibo-panel--title--font-size--is-sticking: $ibo-font-size-150 !default;
$ibo-panel--title--color: $ibo-color-grey-900 !default;
@@ -179,24 +182,25 @@ $ibo-panel--is-selectable--body--after--font-size: $ibo-font-size-700 !default;
min-height: $ibo-panel--icon--size;
}
.ibo-panel--icon-background {
.ibo-panel--icon-img, .ibo-panel--icon-background { // second class is deprecated, remove it when dealing with N°9317
width: 100%;
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: $ibo-panel--icon-background--size--must-contain;
background-size: $ibo-panel--icon-img--size--must-contain;
}
.ibo-panel--icon-background--must-contain {
background-size: $ibo-panel--icon-background--size--must-contain;
.ibo-panel--icon-img--must-contain, .ibo-panel--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-panel--icon-img--size--must-contain;
}
.ibo-panel--icon-background--must-cover {
background-size: $ibo-panel--icon-background--size--must-cover;
.ibo-panel--icon-img--must-cover, .ibo-panel--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-panel--icon-img--size--must-cover;
}
.ibo-panel--icon-background--must-zoomout {
background-size: $ibo-panel--icon-background--size--must-zoomout;
.ibo-panel--icon-img--must-zoomout, .ibo-panel--icon-background--must-zoomout { // second class is deprecated, remove it when dealing with N°9317
width: $ibo-panel--icon-img--size--must-zoomout;
height: $ibo-panel--icon-img--size--must-zoomout;
}
.ibo-panel--title {

View File

@@ -11,9 +11,12 @@ $ibo-title--icon--size: 90px !default;
$ibo-title--icon--size-2: 80px !default;
$ibo-title--icon--size-3: 70px !default;
$ibo-title--icon-background--size--must-contain: contain !default;
$ibo-title--icon-background--size--must-cover: cover !default;
$ibo-title--icon-background--size--must-zoomout: 66.67% !default;
$ibo-title--icon-background--size--must-contain: contain !default; // deprecated, to be removed in favor of $ibo-title--icon-img--size--must-contain
$ibo-title--icon-background--size--must-cover: cover !default; // deprecated, to be removed in favor of $ibo-title--icon-img--size--must-cover
$ibo-title--icon-background--size--must-zoomout: 66.67% !default; // deprecated, to be removed in favor of $ibo-title--icon-img--size--must-zoomout
$ibo-title--icon-img--size--must-contain: $ibo-title--icon-background--size--must-contain !default; // TODO remove when dealing with N°9317
$ibo-title--icon-img--size--must-cover: $ibo-title--icon-background--size--must-cover !default; // TODO remove when dealing with N°9317
$ibo-title--icon-img--size--must-zoomout: $ibo-title--icon-background--size--must-zoomout !default; // TODO remove when dealing with N°9317
.ibo-title {
@@ -44,24 +47,23 @@ $ibo-title--icon-background--size--must-zoomout: 66.67% !default;
min-height: $ibo-title--icon--size-3;
}
.ibo-title--icon-background {
.ibo-title--icon-img, .ibo-title--icon-background { // second class is deprecated, remove it when dealing with N°9317
width: 100%;
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: $ibo-title--icon-background--size--must-contain;
object-position: center;
background-size: $ibo-title--icon-img--size--must-contain;
}
.ibo-title--icon-background--must-contain {
background-size: $ibo-title--icon-background--size--must-contain;
.ibo-title--icon-img--must-contain, .ibo-title--icon-background--must-contain { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-title--icon-img--size--must-contain;
}
.ibo-title--icon-background--must-cover {
background-size: $ibo-title--icon-background--size--must-cover;
.ibo-title--icon-img--must-cover, .ibo-title--icon-background--must-cover { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-title--icon-img--size--must-cover;
}
.ibo-title--icon-background--must-zoomout {
background-size: $ibo-title--icon-background--size--must-zoomout;
.ibo-title--icon-img--must-zoomout, .ibo-title--icon-background--must-zoomout { // second class is deprecated, remove it when dealing with N°9317
background-size: $ibo-title--icon-img--size--must-zoomout;
}
.ibo-title--for-object-details {

View File

@@ -29,7 +29,7 @@ $ibo-vendors-selectize--element--active--background: $ibo-color-blue-100 !defaul
$ibo-vendors-selectize--element--active--color: $ibo-color-grey-900 !default;
$ibo-vendors-selectize--dropdown--background-color: $ibo-vendors-selectize-input--background-color !default;
$ibo-vendors-selectize--dropdown--color: $ibo-vendors-selectize-input--color!default;
$ibo-vendors-selectize--dropdown--color: $ibo-vendors-selectize-input--color !default;
$ibo-vendors-selectize--header--padding-x: 8px !default;
$ibo-vendors-selectize--header--padding-y: 5px !default;

View File

@@ -24,7 +24,7 @@ class DBRestore extends DBBackup
/** @var string */
private $sDBUser;
public function __construct(\Config $oConfig = null)
public function __construct(?\Config $oConfig = null)
{
parent::__construct($oConfig);

View File

@@ -18,7 +18,7 @@ class HubNewsroomProvider extends NewsroomProviderBase
* {@inheritDoc}
* @see NewsroomProviderBase::IsApplicable()
*/
public function IsApplicable(User $oUser = null)
public function IsApplicable(?User $oUser = null)
{
if ($oUser !== null) {
return UserRights::IsAdministrator($oUser);

View File

@@ -27,7 +27,7 @@ class PortalCollector extends AbstractDataCollector
}
/** @inheritdoc */
public function collect(Request $request, Response $response, Throwable $exception = null): void
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
{
$oRegister = $this->oTemplatesProviderService->GetRegister();
$aTemplatesDefinitions = $oRegister->GetTemplatesDefinitions();

View File

@@ -129,7 +129,7 @@ class ObjectFormHandlerHelper
* @throws \OQLException
* @throws \Exception
*/
public function HandleForm(Request $oRequest, $sMode, $sObjectClass, $sObjectId = null, array $aFormProperties = null)
public function HandleForm(Request $oRequest, $sMode, $sObjectClass, $sObjectId = null, ?array $aFormProperties = null)
{
$aFormData = [];
$sOperation = $this->oRequestManipulator->ReadParam('operation', '');

View File

@@ -40,7 +40,7 @@ class AppVariable implements ArrayAccess
/** @var DecoratedAppVariable */
private $decorated;
public function __construct(DecoratedAppVariable $decorated, ContainerInterface $container = null)
public function __construct(DecoratedAppVariable $decorated, ?ContainerInterface $container = null)
{
$this->decorated = $decorated;
$this->container = $container;

View File

@@ -57,7 +57,7 @@ class TemplatesTwigExtension extends AbstractExtension
* @return string the template path
* @throws \ReflectionException
*/
public function GetTemplate(string $sId, string $sProviderClass = self::DEFAULT_PROVIDER_CLASS, object $oProviderInstance = null): string
public function GetTemplate(string $sId, string $sProviderClass = self::DEFAULT_PROVIDER_CLASS, ?object $oProviderInstance = null): string
{
if ($oProviderInstance === null) {
return $this->oTemplatesService->GetTemplatePath($sProviderClass, $sId);

View File

@@ -14,7 +14,10 @@ if (PHP_VERSION_ID < 50600) {
echo $err;
}
}
throw new RuntimeException($err);
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';

View File

@@ -744,6 +744,8 @@ return array(
'Firebase\\JWT\\JWTExceptionWithPayloadInterface' => $vendorDir . '/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php',
'Firebase\\JWT\\Key' => $vendorDir . '/firebase/php-jwt/src/Key.php',
'Firebase\\JWT\\SignatureInvalidException' => $vendorDir . '/firebase/php-jwt/src/SignatureInvalidException.php',
'ForgotPasswordApplicationException' => $baseDir . '/application/exceptions/ForgotPasswordApplicationException.php',
'ForgotPasswordUserInputException' => $baseDir . '/application/exceptions/ForgotPasswordUserInputException.php',
'FunctionExpression' => $baseDir . '/core/oql/expression.class.inc.php',
'FunctionOqlExpression' => $baseDir . '/core/oql/oqlquery.class.inc.php',
'GraphEdge' => $baseDir . '/core/simplegraph.class.inc.php',
@@ -2262,17 +2264,6 @@ return array(
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface' => $vendorDir . '/symfony/http-foundation/Session/Storage/SessionStorageInterface.php',
'Symfony\\Component\\HttpFoundation\\StreamedJsonResponse' => $vendorDir . '/symfony/http-foundation/StreamedJsonResponse.php',
'Symfony\\Component\\HttpFoundation\\StreamedResponse' => $vendorDir . '/symfony/http-foundation/StreamedResponse.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\RequestAttributeValueSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseCookieValueSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseFormatSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHasCookie' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHasHeader' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHeaderLocationSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseHeaderLocationSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHeaderSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsRedirected' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsSuccessful' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsUnprocessable' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseStatusCodeSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php',
'Symfony\\Component\\HttpFoundation\\UriSigner' => $vendorDir . '/symfony/http-foundation/UriSigner.php',
'Symfony\\Component\\HttpFoundation\\UrlHelper' => $vendorDir . '/symfony/http-foundation/UrlHelper.php',
'Symfony\\Component\\HttpKernel\\Attribute\\AsController' => $vendorDir . '/symfony/http-kernel/Attribute/AsController.php',
@@ -3159,6 +3150,7 @@ return array(
'iRestServiceProvider' => $baseDir . '/application/applicationextension.inc.php',
'iScheduledProcess' => $baseDir . '/core/backgroundprocess.inc.php',
'iSelfRegister' => $baseDir . '/core/userrights.class.inc.php',
'iTokenLoginUIExtension' => $baseDir . '/application/applicationextension/login/iTokenLoginUIExtension.php',
'iTopConfigParser' => $baseDir . '/core/iTopConfigParser.php',
'iTopMutex' => $baseDir . '/core/mutex.class.inc.php',
'iTopOwnershipLock' => $baseDir . '/core/ownershiplock.class.inc.php',

View File

@@ -56,7 +56,7 @@ return array(
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'Pelago\\Emogrifier\\' => array($vendorDir . '/pelago/emogrifier/src'),
'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-google/src', $vendorDir . '/league/oauth2-client/src'),
'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-client/src', $vendorDir . '/league/oauth2-google/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),

View File

@@ -314,8 +314,8 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
),
'League\\OAuth2\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/league/oauth2-google/src',
1 => __DIR__ . '/..' . '/league/oauth2-client/src',
0 => __DIR__ . '/..' . '/league/oauth2-client/src',
1 => __DIR__ . '/..' . '/league/oauth2-google/src',
),
'GuzzleHttp\\Psr7\\' =>
array (
@@ -1103,6 +1103,8 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
'Firebase\\JWT\\JWTExceptionWithPayloadInterface' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php',
'Firebase\\JWT\\Key' => __DIR__ . '/..' . '/firebase/php-jwt/src/Key.php',
'Firebase\\JWT\\SignatureInvalidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/SignatureInvalidException.php',
'ForgotPasswordApplicationException' => __DIR__ . '/../..' . '/application/exceptions/ForgotPasswordApplicationException.php',
'ForgotPasswordUserInputException' => __DIR__ . '/../..' . '/application/exceptions/ForgotPasswordUserInputException.php',
'FunctionExpression' => __DIR__ . '/../..' . '/core/oql/expression.class.inc.php',
'FunctionOqlExpression' => __DIR__ . '/../..' . '/core/oql/oqlquery.class.inc.php',
'GraphEdge' => __DIR__ . '/../..' . '/core/simplegraph.class.inc.php',
@@ -2621,17 +2623,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/SessionStorageInterface.php',
'Symfony\\Component\\HttpFoundation\\StreamedJsonResponse' => __DIR__ . '/..' . '/symfony/http-foundation/StreamedJsonResponse.php',
'Symfony\\Component\\HttpFoundation\\StreamedResponse' => __DIR__ . '/..' . '/symfony/http-foundation/StreamedResponse.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\RequestAttributeValueSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseCookieValueSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseFormatSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHasCookie' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHasHeader' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHeaderLocationSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseHeaderLocationSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseHeaderSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsRedirected' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsSuccessful' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsUnprocessable' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php',
'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseStatusCodeSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php',
'Symfony\\Component\\HttpFoundation\\UriSigner' => __DIR__ . '/..' . '/symfony/http-foundation/UriSigner.php',
'Symfony\\Component\\HttpFoundation\\UrlHelper' => __DIR__ . '/..' . '/symfony/http-foundation/UrlHelper.php',
'Symfony\\Component\\HttpKernel\\Attribute\\AsController' => __DIR__ . '/..' . '/symfony/http-kernel/Attribute/AsController.php',
@@ -3518,6 +3509,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
'iRestServiceProvider' => __DIR__ . '/../..' . '/application/applicationextension.inc.php',
'iScheduledProcess' => __DIR__ . '/../..' . '/core/backgroundprocess.inc.php',
'iSelfRegister' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'iTokenLoginUIExtension' => __DIR__ . '/../..' . '/application/applicationextension/login/iTokenLoginUIExtension.php',
'iTopConfigParser' => __DIR__ . '/../..' . '/core/iTopConfigParser.php',
'iTopMutex' => __DIR__ . '/../..' . '/core/mutex.class.inc.php',
'iTopOwnershipLock' => __DIR__ . '/../..' . '/core/ownershiplock.class.inc.php',

View File

@@ -36,7 +36,8 @@ if ($issues) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View File

@@ -980,11 +980,13 @@ try {
JS
);
} else {
$sDashboardIdEncoded = json_encode($sDashboardId);
$sReloadURLEncoded = json_encode($sReloadURL);
$oPage->add_script(
<<<JS
$('.ibo-dashboard#{$sDashboardDivId}').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'reload_dashboard', dashboard_id: '{$sDashboardId}', file: '{$sDashboardFile}', extra_params: {$sJSExtraParams}, reload_url: '{$sReloadURL}'},
{ operation: 'reload_dashboard', dashboard_id: {$sDashboardIdEncoded}, file: '{$sDashboardFile}', extra_params: {$sJSExtraParams}, reload_url: {$sReloadURLEncoded}},
function(data){
$('.ibo-dashboard#{$sDashboardDivId}').html(data);
$('.ibo-dashboard#{$sDashboardDivId}').unblock();
@@ -1004,11 +1006,13 @@ JS
$sFile = addslashes($oDashboard->GetDefinitionFile());
$sDivId = utils::Sanitize($sDashboardId, '', 'element_identifier');
// trigger a reload of the current page since the dashboard just changed
$sDashboardIdEncoded = json_encode($sDashboardId);
$sReloadURLEncoded = json_encode($sReloadURL);
$oPage->add_script(
<<<EOF
$('.ibo-dashboard#$sDivId').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'reload_dashboard', dashboard_id: '$sDashboardId', file: '$sFile', reload_url: '$sReloadURL'},
{ operation: 'reload_dashboard', dashboard_id: $sDashboardIdEncoded, file: '$sFile', reload_url: $sReloadURLEncoded},
function(data){
$('.ibo-dashboard#$sDivId').html(data);
$('.ibo-dashboard#$sDivId').unblock();
@@ -2136,7 +2140,7 @@ EOF
$oAttachment->Set('item_class', $sObjClass);
$oAttachment->SetDefaultOrgId();
$oAttachment->Set('contents', $oDoc);
$oAttachment->Set('secret', sprintf('%06x', mt_rand(0, 0xFFFFFF))); // something not easy to guess
$oAttachment->Set('secret', bin2hex(random_bytes(16))); // 128 bits of entropy, cryptographically secure
$iAttId = $oAttachment->DBInsert();
$aResult['uploaded'] = 1;
@@ -2194,7 +2198,7 @@ EOF
$oAttachment->Set('item_class', $sObjClass);
$oAttachment->SetDefaultOrgId();
$oAttachment->Set('contents', $oDoc);
$oAttachment->Set('secret', sprintf('%06x', mt_rand(0, 0xFFFFFF))); // something not easy to guess
$oAttachment->Set('secret', bin2hex(random_bytes(16))); // 128 bits of entropy, cryptographically secure
$iAttId = $oAttachment->DBInsert();
IssueLog::Trace('InlineImage created', LogChannels::INLINE_IMAGE, [

View File

@@ -152,7 +152,7 @@ class DBBackup
* @return string Name of the backup file WITHOUT the file extension (eg. `.tar.gz`)
* @since 3.1.0 N°5279 Add $oDateTime parameter
*/
public function MakeName(string $sNameSpec = "__DB__-%Y-%m-%d", DateTime $oDateTime = null)
public function MakeName(string $sNameSpec = "__DB__-%Y-%m-%d", ?DateTime $oDateTime = null)
{
if ($oDateTime === null) {
$oDateTime = new DateTime();

View File

@@ -38,7 +38,7 @@ class DOMFormatException extends Exception
* @param $previous
* @param DesignElement|null $node DOMNode causing the DOMFormatException
*/
public function __construct($message, $code = 0, $previous = null, DesignElement $node = null)
public function __construct($message, $code = 0, $previous = null, ?DesignElement $node = null)
{
if ($node !== null) {
$message .= ' ('.MFDocument::GetItopNodePath($node).' at line '.$node->getLineNo().')';
@@ -930,7 +930,7 @@ EOF
*
* @since 3.0.0 Add param. $bAddQuotes to be equivalent to {@see self::GetMandatoryPropString} and allow retrieving property without surrounding single quotes
*/
protected function GetPropString($oNode, string $sTag, string $sDefault = null, bool $bAddQuotes = true)
protected function GetPropString($oNode, string $sTag, ?string $sDefault = null, bool $bAddQuotes = true)
{
$val = $oNode->GetChildText($sTag);
if (is_null($val)) {

View File

@@ -2399,7 +2399,7 @@ class MFDocument extends \Combodo\iTop\DesignDocument
*/
// Return type union is not supported by PHP 7.4, we can remove the following PHP attribute and add the return type once iTop min PHP version is PHP 8.0+
#[\ReturnTypeWillChange]
public function saveXML(DOMNode $node = null, $options = 0)
public function saveXML(?DOMNode $node = null, $options = 0)
{
$oRootNode = $this->firstChild;
if (!$oRootNode) {

View File

@@ -126,7 +126,7 @@ class CKEditorHelper
*
* @return string|null
*/
public static function PrepareCKEditorValueTextEncodingForTextarea(string $sValue = null): ?string
public static function PrepareCKEditorValueTextEncodingForTextarea(?string $sValue = null): ?string
{
if ($sValue === null) {
return null;
@@ -145,7 +145,7 @@ class CKEditorHelper
*
* @return void
*/
public static function ConfigureCKEditorElementForWebPage(WebPage $oPage, string $sInputElementId, string $sInitialValue = null, bool $bWithMentions = false, array $aOverloadConfiguration = []): void
public static function ConfigureCKEditorElementForWebPage(WebPage $oPage, string $sInputElementId, ?string $sInitialValue = null, bool $bWithMentions = false, array $aOverloadConfiguration = []): void
{
// link CKEditor JS files
foreach (static::GetJSFilesRelPathsForCKEditor() as $sFile) {
@@ -187,7 +187,7 @@ class CKEditorHelper
*
* @return void
*/
public static function ConfigureCKEditorElementForRenderingOutput(RenderingOutput $oOutput, string $sInputElementId, string $sInitialValue = null, bool $bWithMentions = false, bool $bAddJSFiles = true, array $aOverloadConfiguration = []): void
public static function ConfigureCKEditorElementForRenderingOutput(RenderingOutput $oOutput, string $sInputElementId, ?string $sInitialValue = null, bool $bWithMentions = false, bool $bAddJSFiles = true, array $aOverloadConfiguration = []): void
{
// link CKEditor JS files
if ($bAddJSFiles) {
@@ -282,7 +282,7 @@ HTML;
* @throws \ConfigException
* @throws \CoreException
*/
public static function GetDOMSanitizerForCKEditor(DOMSanitizer $oSanitizer = null): array
public static function GetDOMSanitizerForCKEditor(?DOMSanitizer $oSanitizer = null): array
{
if ($oSanitizer === null) {
/* @var $oSanitizer DOMSanitizer */

View File

@@ -18,7 +18,7 @@ use User;
*/
class iTopNewsroomProvider extends NewsroomProviderBase
{
public function IsApplicable(User $oUser = null)
public function IsApplicable(?User $oUser = null)
{
return true;
}

View File

@@ -16,7 +16,7 @@ class Status
* @throws \DictExceptionUnknownLanguage
* @throws \MySQLException
*/
public function __construct(Config $oConfig = null)
public function __construct(?Config $oConfig = null)
{
$this->StatusStartup($oConfig);
}
@@ -74,7 +74,7 @@ class Status
* @throws \DictExceptionUnknownLanguage
* @throws \MySQLException
*/
private function StatusStartup(Config $oConfig = null)
private function StatusStartup(?Config $oConfig = null)
{
$this->StatusCheckConfigFile();

View File

@@ -96,7 +96,7 @@ class Button extends UIBlock
* @param string $sJsCode
* @param string $sOnClickJsCode
*/
public function __construct(string $sLabel, string $sId = null, string $sTooltip = '', string $sIconClass = '', string $sActionType = self::DEFAULT_ACTION_TYPE, string $sColorScheme = self::DEFAULT_COLOR_SCHEME, string $sJsCode = '', string $sOnClickJsCode = '')
public function __construct(string $sLabel, ?string $sId = null, string $sTooltip = '', string $sIconClass = '', string $sActionType = self::DEFAULT_ACTION_TYPE, string $sColorScheme = self::DEFAULT_COLOR_SCHEME, string $sJsCode = '', string $sOnClickJsCode = '')
{
// We only use resource ID (not sanitized) on button for now, but this might be reworked back into \UIBlock if needed
if (!is_null($sId)) {

View File

@@ -67,7 +67,7 @@ class ButtonJS extends Button
*/
public function __construct(
string $sLabel,
string $sId = null,
?string $sId = null,
string $sName = '',
string $sValue = '',
string $sType = self::DEFAULT_TYPE,

View File

@@ -55,7 +55,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Button\Button
*/
public static function MakeNeutral(string $sLabel, string $sName = null, ?string $sId = null)
public static function MakeNeutral(string $sLabel, ?string $sName = null, ?string $sId = null)
{
$oButton = new ButtonJS($sLabel, $sId);
$oButton->SetActionType(Button::ENUM_ACTION_TYPE_REGULAR)
@@ -81,8 +81,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForPrimaryAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -102,8 +102,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForSecondaryAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -123,8 +123,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForPositiveAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -145,8 +145,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForDestructiveAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -178,8 +178,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeAlternativeNeutral(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -208,8 +208,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForAlternativePrimaryAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -237,8 +237,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForAlternativeSecondaryAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -266,8 +266,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForAlternativeValidationAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -295,8 +295,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForAlternativeDestructiveAction(
string $sLabel,
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -323,9 +323,9 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
* @return \Combodo\iTop\Application\UI\Base\Component\Button\Button
*/
public static function MakeForCancel(
string $sLabel = null,
string $sName = null,
string $sValue = null,
?string $sLabel = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -356,8 +356,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
public static function MakeIconAction(
string $sIconClasses,
string $sTooltipText = '',
string $sName = null,
string $sValue = null,
?string $sName = null,
?string $sValue = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -483,8 +483,8 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
string $sLabel,
string $sColor,
string $sActionType,
string $sValue = null,
string $sName = null,
?string $sValue = null,
?string $sName = null,
bool $bIsSubmit = false,
?string $sId = null
) {
@@ -528,7 +528,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
string $sURL,
string $sColor,
string $sActionType,
string $sTarget = null,
?string $sTarget = null,
?string $sId = null
) {
$oButton = new ButtonURL($sLabel, $sURL, $sId, $sTarget);

View File

@@ -67,7 +67,7 @@ class ButtonURL extends Button
public function __construct(
string $sLabel,
string $sURL,
string $sId = null,
?string $sId = null,
string $sTarget = self::DEFAULT_TARGET,
string $sTooltip = '',
string $sIconClass = '',

View File

@@ -14,7 +14,7 @@ class DashletContainer extends UIContentBlock
public const BLOCK_CODE = 'ibo-dashlet';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/layouts/content-block/layout';
public function __construct(string $sId = null, array $aContainerClasses = [])
public function __construct(?string $sId = null, array $aContainerClasses = [])
{
parent::__construct($sId, $aContainerClasses);

View File

@@ -22,12 +22,12 @@ class DashletFactory
return new DashletBadge($sClassIconUrl, $sHyperlink, $iCount, $sClassLabel, $sCreateActionUrl, $sCreateActionLabel, $aRefreshParams);
}
public static function MakeForDashletHeaderStatic(string $sTitle, string $sIconUrl, string $sId = null): DashletHeaderStatic
public static function MakeForDashletHeaderStatic(string $sTitle, string $sIconUrl, ?string $sId = null): DashletHeaderStatic
{
return new DashletHeaderStatic($sTitle, $sIconUrl, $sId);
}
public static function MakeForDashletPlainText(string $sText, string $sId = null): DashletPlainText
public static function MakeForDashletPlainText(string $sText, ?string $sId = null): DashletPlainText
{
return new DashletPlainText($sText, $sId);
}

View File

@@ -33,7 +33,7 @@ class DashletHeaderStatic extends DashletContainer
* @param string $sIconUrl
* @param string|null $sId
*/
public function __construct(string $sTitle, string $sIconUrl, string $sId = null)
public function __construct(string $sTitle, string $sIconUrl, ?string $sId = null)
{
parent::__construct($sId);

View File

@@ -29,7 +29,7 @@ class DashletPlainText extends DashletContainer
*
* @param string $sText
*/
public function __construct(string $sText, string $sId = null)
public function __construct(string $sText, ?string $sId = null)
{
parent::__construct($sId);

View File

@@ -855,7 +855,7 @@ JS;
*
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
*/
public static function MakeForStaticData(string $sTitle, array $aColumns, array $aData, ?string $sId = null, array $aExtraParams = [], string $sFilter = "", array $aOptions = [], array $aRowActions = null)
public static function MakeForStaticData(string $sTitle, array $aColumns, array $aData, ?string $sId = null, array $aExtraParams = [], string $sFilter = "", array $aOptions = [], ?array $aRowActions = null)
{
$oBlock = new UIContentBlock();
if ($sTitle != "") {
@@ -896,7 +896,7 @@ JS;
*
* @return \Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTable\FormTable
*/
public static function MakeForForm(string $sRef, array $aColumns, array $aData = [], string $sFilter = '', array $aRowActions = null)
public static function MakeForForm(string $sRef, array $aColumns, array $aData = [], string $sFilter = '', ?array $aRowActions = null)
{
$oTable = new FormTable("datatable_".$sRef);
$oTable->SetRef($sRef);

View File

@@ -67,7 +67,7 @@ class StaticTable extends UIContentBlock
*/
private $aOptions;
public function __construct(string $sId = null, array $aContainerCSSClasses = [], array $aExtraParams = [])
public function __construct(?string $sId = null, array $aContainerCSSClasses = [], array $aExtraParams = [])
{
parent::__construct($sId, $aContainerCSSClasses);
$this->aColumns = [];

View File

@@ -57,7 +57,7 @@ class Field extends UIContentBlock
/** @var string */
protected $sComments;
public function __construct(string $sLabel, UIBlock $oValue = null, ?string $sId = null)
public function __construct(string $sLabel, ?UIBlock $oValue = null, ?string $sId = null)
{
parent::__construct($sId);
$this->sLabel = $sLabel;

View File

@@ -19,7 +19,7 @@ class FieldBadge extends UIContentBlock
// Overloaded constants
public const BLOCK_CODE = 'ibo-field-badge';
public function __construct(string $sId = null, array $aContainerClasses = [])
public function __construct(?string $sId = null, array $aContainerClasses = [])
{
parent::__construct($sId, $aContainerClasses);
}

View File

@@ -25,7 +25,7 @@ class Form extends UIContentBlock
/** @var string */
protected $sAction;
public function __construct(string $sId = null)
public function __construct(?string $sId = null)
{
parent::__construct($sId);
$this->sOnSubmitJsCode = null;

View File

@@ -30,7 +30,7 @@ class FormUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Form\Form An HTML form in which you can add UIBlocks
*/
public static function MakeStandard(string $sId = null)
public static function MakeStandard(?string $sId = null)
{
return new Form($sId);
}

View File

@@ -26,7 +26,7 @@ class FileSelect extends UIBlock
/** @var bool */
private $bShowFilename;
public function __construct(string $sName, string $sId = null)
public function __construct(string $sName, ?string $sId = null)
{
parent::__construct($sId);
$this->sName = $sName;

View File

@@ -31,7 +31,7 @@ class FileSelectUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\FileSelect\FileSelect A styled file input selector
*/
public static function MakeStandard(string $sName, string $sId = null)
public static function MakeStandard(string $sName, ?string $sId = null)
{
return new FileSelect($sName, $sId);
}

View File

@@ -36,7 +36,7 @@ class AjaxDataProviderForOQL extends AjaxDataProvider
* @param string|null $sWizardHelperJsVarName Wizard helper name
* @param array $aFieldsToLoad Array of fields to load
*/
public function __construct(string $sObjectClass, string $sOql, string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [])
public function __construct(string $sObjectClass, string $sOql, ?string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [])
{
parent::__construct('object.search', [
'object_class' => $sObjectClass,

View File

@@ -107,7 +107,7 @@ class Set extends AbstractInput
*
* @param string|null $sId Block identifier
*/
public function __construct(string $sId = null)
public function __construct(?string $sId = null)
{
parent::__construct($sId);

View File

@@ -138,7 +138,7 @@ class SetUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Set\Set
*/
public static function MakeForOQL(string $sId, string $sObjectClass, string $sOql, string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [], ?string $sGroupField = null, string $sName = ''): Set
public static function MakeForOQL(string $sId, string $sObjectClass, string $sOql, ?string $sWizardHelperJsVarName = null, array $aFieldsToLoad = [], ?string $sGroupField = null, string $sName = ''): Set
{
// Create set ui block
$oSetUIBlock = new Set($sId);

View File

@@ -36,7 +36,7 @@ class DoNotShowAgainOptionBlock extends UIContentBlock
*
* @param string|null $sId
*/
public function __construct(string $sId = null)
public function __construct(?string $sId = null)
{
parent::__construct($sId, ['ibo-modal-option--do-not-show-again']);

View File

@@ -48,7 +48,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeNeutral(string $sTitle, string $sSubTitle = null)
public static function MakeNeutral(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -68,7 +68,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForInformation(string $sTitle, string $sSubTitle = null)
public static function MakeForInformation(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -88,7 +88,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForSuccess(string $sTitle, string $sSubTitle = null)
public static function MakeForSuccess(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -108,7 +108,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForWarning(string $sTitle, string $sSubTitle = null)
public static function MakeForWarning(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -128,7 +128,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForDanger(string $sTitle, string $sSubTitle = null)
public static function MakeForDanger(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -148,7 +148,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForFailure(string $sTitle, string $sSubTitle = null)
public static function MakeForFailure(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -168,7 +168,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeWithBrandingPrimaryColor(string $sTitle, string $sSubTitle = null)
public static function MakeWithBrandingPrimaryColor(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -188,7 +188,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeWithBrandingSecondaryColor(string $sTitle, string $sSubTitle = null)
public static function MakeWithBrandingSecondaryColor(string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {
@@ -209,7 +209,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel
*/
public static function MakeForClass(string $sClass, string $sTitle, string $sSubTitle = null)
public static function MakeForClass(string $sClass, string $sTitle, ?string $sSubTitle = null)
{
$oPanel = new Panel($sTitle);
if (!is_null($sSubTitle)) {

View File

@@ -31,7 +31,7 @@ class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator\VerticalSeparator
*/
public static function MakeVertical(string $sId = null)
public static function MakeVertical(?string $sId = null)
{
return new VerticalSeparator($sId);
}

View File

@@ -20,7 +20,7 @@ class Toolbar extends UIContentBlock
public const BLOCK_CODE = 'ibo-toolbar';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/toolbar/layout';
public function __construct(string $sId = null, array $aContainerClasses = [])
public function __construct(?string $sId = null, array $aContainerClasses = [])
{
parent::__construct($sId, $aContainerClasses);
}

View File

@@ -30,7 +30,7 @@ class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer\ToolbarSpacer
*/
public static function MakeStandard(string $sId = null)
public static function MakeStandard(?string $sId = null)
{
return new ToolbarSpacer($sId);
}

View File

@@ -30,7 +30,7 @@ class ToolbarUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeForAction(string $sId = null)
public static function MakeForAction(?string $sId = null)
{
return new Toolbar($sId, ['ibo-toolbar--action']);
}
@@ -42,7 +42,7 @@ class ToolbarUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeStandard(string $sId = null, array $aContainerClasses = [])
public static function MakeStandard(?string $sId = null, array $aContainerClasses = [])
{
return new Toolbar($sId, $aContainerClasses);
}
@@ -54,7 +54,7 @@ class ToolbarUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeForButton(string $sId = null, array $aContainerClasses = [])
public static function MakeForButton(?string $sId = null, array $aContainerClasses = [])
{
return new Toolbar($sId, array_merge($aContainerClasses, ['ibo-toolbar--button']));
}

View File

@@ -62,7 +62,7 @@ class CaseLogEntryForm extends UIContentBlock
* @param \DBObject $oObject
* @param string|null $sId
*/
public function __construct(DBObject $oObject, string $sAttCode, string $sId = null)
public function __construct(DBObject $oObject, string $sAttCode, ?string $sId = null)
{
parent::__construct($sId);
$this->oObject = $oObject;

View File

@@ -107,7 +107,7 @@ class NavigationMenu extends UIBlock implements iKeyboardShortcut
public function __construct(
ApplicationContext $oAppContext,
PopoverMenu $oUserMenu,
NewsroomMenu $oNewsroomMenu = null,
?NewsroomMenu $oNewsroomMenu = null,
?string $sId = null
) {
parent::__construct($sId);

View File

@@ -59,9 +59,9 @@ class TopBar extends UIBlock
*/
public function __construct(
$sId = null,
QuickCreate $oQuickCreate = null,
GlobalSearch $oGlobalSearch = null,
Breadcrumbs $oBreadcrumbs = null
?QuickCreate $oQuickCreate = null,
?GlobalSearch $oGlobalSearch = null,
?Breadcrumbs $oBreadcrumbs = null
) {
parent::__construct($sId);

View File

@@ -33,6 +33,10 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
protected $aDeferredBlocks;
/** @var bool If set to true, the content block will have a surrounding <div> no matter its options / CSS classes / ... */
protected $bHasForcedDiv;
/** @var bool if set to true, the icon will be lazy loaded
* @since 3.2.3
*/
protected bool $bHasLazyLoadIcon;
/**
* UIContentBlock constructor.
@@ -41,13 +45,14 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
* @param string|null $sId
* @param array $aContainerClasses Array of additional CSS classes
*/
public function __construct(string $sId = null, array $aContainerClasses = [])
public function __construct(?string $sId = null, array $aContainerClasses = [])
{
parent::__construct($sId);
$this->aSubBlocks = [];
$this->aDeferredBlocks = [];
$this->bHasForcedDiv = false;
$this->bHasLazyLoadIcon = false;
$this->SetCSSClasses($aContainerClasses);
}
@@ -220,4 +225,24 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
$this->bHasForcedDiv = $bHasForcedDiv;
return $this;
}
/**
* @see static::$bHasLazyLoadIcon
* @return bool
*/
public function HasLazyLoadIcon(): bool
{
return $this->bHasLazyLoadIcon;
}
/**
* @see static::$bHasLazyLoadIcon
* @param bool $bLazyLoadIcon
* @return $this
*/
public function SetHasLazyLoadIcon(bool $bLazyLoadIcon)
{
$this->bHasLazyLoadIcon = $bLazyLoadIcon;
return $this;
}
}

View File

@@ -34,7 +34,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
*/
public static function MakeStandard(string $sId = null, array $aContainerClasses = [])
public static function MakeStandard(?string $sId = null, array $aContainerClasses = [])
{
return new UIContentBlock($sId, $aContainerClasses);
}
@@ -49,7 +49,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
*/
public static function MakeForCode(string $sCode, string $sId = null)
public static function MakeForCode(string $sCode, ?string $sId = null)
{
$sCode = str_replace("\n", '<br>', \utils::HtmlEntities($sCode));
@@ -65,7 +65,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
*/
public static function MakeForPreformatted(string $sCode, string $sId = null)
public static function MakeForPreformatted(string $sCode, ?string $sId = null)
{
$sCode = '<pre>'.\utils::HtmlEntities($sCode).'</pre>';

View File

@@ -12,7 +12,7 @@ use Throwable;
class UIException extends Exception
{
public function __construct(iUIBlock $oBlock, string $message = "", int $code = 0, Throwable $previous = null)
public function __construct(iUIBlock $oBlock, string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($oBlock->GetId().': '.$message, $code, $previous);
}

View File

@@ -139,7 +139,7 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
* @throws \ArchivedObjectException
* @throws \CoreException
*/
public function GetDictionaryEntry(string $sKey, DBObject $oDBObject = null)
public function GetDictionaryEntry(string $sKey, ?DBObject $oDBObject = null)
{
return $this->oAttDef->SearchSpecificLabel(
$sKey,

View File

@@ -51,7 +51,7 @@ class LinkSetUIBlockFactory extends SetUIBlockFactory
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Set\Set
*/
public static function MakeForLinkSet(string $sId, AttributeLinkedSet $oAttDef, iDBObjectSetIterator $oDbObjectSet, string $sWizardHelperJsVarName, DBObject $oHostDbObject = null): Set
public static function MakeForLinkSet(string $sId, AttributeLinkedSet $oAttDef, iDBObjectSetIterator $oDbObjectSet, string $sWizardHelperJsVarName, ?DBObject $oHostDbObject = null): Set
{
$sTargetClass = LinkSetModel::GetTargetClass($oAttDef);
$sTargetField = LinkSetModel::GetTargetField($oAttDef);

View File

@@ -92,7 +92,7 @@ class AjaxPage extends WebPage implements iTabbedPage
* @inheritDoc
* @throws \Exception
*/
public function AddTabContainer($sTabContainer, $sPrefix = '', iUIContentBlock $oParentBlock = null)
public function AddTabContainer($sTabContainer, $sPrefix = '', ?iUIContentBlock $oParentBlock = null)
{
if (is_null($oParentBlock)) {
$oParentBlock = PanelUIBlockFactory::MakeNeutral('');

View File

@@ -248,7 +248,7 @@ class TabManager
* @param string $sTabCode
* @param string|null $sTabContainer
*/
public function RemoveTab(string $sTabCode, string $sTabContainer = null)
public function RemoveTab(string $sTabCode, ?string $sTabContainer = null)
{
if ($sTabContainer == null) {
$sTabContainer = $this->m_sCurrentTabContainer;
@@ -272,7 +272,7 @@ class TabManager
*
* @return mixed The actual name of the tab (as a string) or false if not found
*/
public function FindTab(string $sPattern, string $sTabContainer = null)
public function FindTab(string $sPattern, ?string $sTabContainer = null)
{
$result = false;
if ($sTabContainer == null) {

View File

@@ -18,7 +18,7 @@ interface iTabbedPage
*
* @return mixed
*/
public function AddTabContainer($sTabContainer, $sPrefix = '', iUIContentBlock $oParentBlock = null);
public function AddTabContainer($sTabContainer, $sPrefix = '', ?iUIContentBlock $oParentBlock = null);
/**
* @param string $sTabContainer

View File

@@ -1024,7 +1024,7 @@ HTML;
* @inheritDoc
* @throws \Exception
*/
public function AddTabContainer($sTabContainer, $sPrefix = '', iUIContentBlock $oParentBlock = null)
public function AddTabContainer($sTabContainer, $sPrefix = '', ?iUIContentBlock $oParentBlock = null)
{
if (is_null($oParentBlock)) {
$oParentBlock = PanelUIBlockFactory::MakeNeutral('');

View File

@@ -7,14 +7,11 @@ use Combodo\iTop\Application\Branding;
use Combodo\iTop\Application\TwigBase\Controller\Controller;
use Combodo\iTop\Application\UI\Base\Component\Button\Button;
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\ButtonGroup\ButtonGroupUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Toggler;
use Combodo\iTop\Application\UI\Base\Component\Panel\Panel;
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\PopoverMenuItemFactory;
use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\Object\ObjectSummary;
@@ -29,13 +26,10 @@ use CoreException;
use DBObjectSearch;
use DBObjectSet;
use Dict;
use JSPopupMenuItem;
use MetaModel;
use SecurityException;
use URLPopupMenuItem;
use UserRights;
use utils;
use appUserPreferences;
/**
* Class iTopNewsroomController
@@ -376,6 +370,7 @@ JS
$sReadColor = $oEvent->Get('read') === 'no' ? 'ibo-notifications--view-all--item--unread' : 'ibo-notifications--view-all--item--read';
$sReadLabel = $oEvent->Get('read') === 'no' ? Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:Unread:Label') : Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:Read:Label');
$oEventBlock = new ObjectSummary($oEvent);
$oEventBlock->SetHasLazyLoadIcon(true);
$oEventBlock->SetCSSColorClass($sReadColor);
$oEventBlock->SetSubTitle($sReadLabel);
$oEventBlock->SetClassLabel('');

View File

@@ -38,7 +38,7 @@ class DateTimeField extends StringField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
parent::__construct($sId, $onFinalizeCallback);
$this->bDateOnly = false;

View File

@@ -89,7 +89,7 @@ abstract class Field
* @param string $sId
* @param \Closure|null $onFinalizeCallback (Used in the $oForm->AddField($sId, ..., function() use ($oManager, $oForm, '...') { ... } ); )
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
$this->sId = $sId;
// No space in such an id, that could be used as a DOM node id

View File

@@ -60,7 +60,7 @@ class FileUploadField extends AbstractSimpleField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
$this->sTransactionId = null;
$this->oObject = null;

View File

@@ -64,7 +64,7 @@ class LinkedSetField extends AbstractSimpleField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
$this->sTargetClass = null;
$this->sExtKeyToRemote = null;

View File

@@ -44,7 +44,7 @@ abstract class MultipleChoicesField extends AbstractSimpleField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
parent::__construct($sId, $onFinalizeCallback);
$this->bMultipleValuesEnabled = static::DEFAULT_MULTIPLE_VALUES_ENABLED;

View File

@@ -45,7 +45,7 @@ class SelectField extends MultipleChoicesField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
parent::__construct($sId, $onFinalizeCallback);
$this->bStartsWithNullChoice = static::DEFAULT_STARTS_WITH_NULL_CHOICE;

View File

@@ -70,7 +70,7 @@ class SelectObjectField extends AbstractSimpleField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
parent::__construct($sId, $onFinalizeCallback);
$this->oSearch = null;

View File

@@ -34,7 +34,7 @@ class SubFormField extends Field
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
$this->oForm = new Form('subform_'.$sId);
parent::__construct($sId, $onFinalizeCallback);

View File

@@ -53,7 +53,7 @@ class TextAreaField extends TextField
* @param \Closure|null $onFinalizeCallback
* @param \DBObject|null $oObject
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null, DBObject $oObject = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null, ?DBObject $oObject = null)
{
parent::__construct($sId, $onFinalizeCallback);
$this->sFormat = static::DEFAULT_FORMAT;

View File

@@ -39,7 +39,7 @@ class UrlField extends StringField
/**
* @inheritDoc
*/
public function __construct(string $sId, Closure $onFinalizeCallback = null)
public function __construct(string $sId, ?Closure $onFinalizeCallback = null)
{
parent::__construct($sId, $onFinalizeCallback);

View File

@@ -48,7 +48,7 @@ abstract class FormRenderer
*
* @param \Combodo\iTop\Form\Form $oForm
*/
public function __construct(Form $oForm = null)
public function __construct(?Form $oForm = null)
{
if ($oForm !== null) {
$this->oForm = $oForm;

View File

@@ -84,7 +84,7 @@ class ObjectRepository
* @return array|null
* @since 3.2.0 Add $iLimit parameter
*/
public static function SearchFromOql(string $sObjectClass, array $aFieldsToLoad, string $sOql, string $sSearch, DBObject $oThisObject = null, int $iLimit = 0): ?array
public static function SearchFromOql(string $sObjectClass, array $aFieldsToLoad, string $sOql, string $sSearch, ?DBObject $oThisObject = null, int $iLimit = 0): ?array
{
try {
@@ -280,7 +280,7 @@ class ObjectRepository
* @throws \CoreException
* @throws \DictExceptionMissingString
*/
public static function ConvertObjectToArray(DBObject $oObject, string $sObjectClass, array $aFieldsToLoad = null, array $aComplementAttributeSpec = null, string $sObjectImageAttCode = null): array
public static function ConvertObjectToArray(DBObject $oObject, string $sObjectClass, ?array $aFieldsToLoad = null, ?array $aComplementAttributeSpec = null, ?string $sObjectImageAttCode = null): array
{
// Retrieve friendly name complementary specification
if ($aComplementAttributeSpec === null) {

View File

@@ -49,7 +49,7 @@ class LinkSetDataTransformer
*
* @return array
*/
public static function Decode(iDBObjectSetIterator $oDbObjectSet, string $sTargetClass, string $sTargetField = null): array
public static function Decode(iDBObjectSetIterator $oDbObjectSet, string $sTargetClass, ?string $sTargetField = null): array
{
try {
// Prepare result
@@ -96,7 +96,7 @@ class LinkSetDataTransformer
*
* @return array{to_be_created: array, to_be_deleted: array, to_be_added: array, to_be_removed: array}
*/
public static function Encode(array $aElements, string $sLinkClass, string $sExtKeyToRemote = null): array
public static function Encode(array $aElements, string $sLinkClass, ?string $sExtKeyToRemote = null): array
{
// Result arrays
$aToBeCreate = [];

View File

@@ -36,7 +36,7 @@ class LinkSetRepository
*
* @return array|null
*/
public static function LinksDbSetToTargetObjectArray(iDBObjectSetIterator $oDbObjectSet, bool $bForce, array &$aInitialOptions, string $sTargetClass, string $sTargetField = null): ?array
public static function LinksDbSetToTargetObjectArray(iDBObjectSetIterator $oDbObjectSet, bool $bForce, array &$aInitialOptions, string $sTargetClass, ?string $sTargetField = null): ?array
{
try {

View File

@@ -188,7 +188,7 @@ class NotificationsRepository
*
* @return DBObjectSet The set of subscriptions matching the given trigger, contact, and action.
*/
public function SearchUnsubscribedSubscriptionsByTriggerContactAndAction(int $iTriggerId, int $iActionId, int $iContactId = null): DBObjectSet
public function SearchUnsubscribedSubscriptionsByTriggerContactAndAction(int $iTriggerId, int $iActionId, ?int $iContactId = null): DBObjectSet
{
$oSearch = $this->PrepareSearchForSubscriptionsByTriggerContactAndAction($iTriggerId, $iActionId, $iContactId);
$oSearch->AddCondition("subscribed", "0");

View File

@@ -18,7 +18,10 @@
{% if oUIBlock.HasIcon() %}
<div class="ibo-panel--icon" data-role="ibo-panel--icon">
{% block iboPanelIcon %}
<div class="ibo-panel--icon-background ibo-panel--icon-background--must-{{ oUIBlock.GetIconCoverMethod() }}" data-role="ibo-panel--icon-background" style="background-image: url('{{ oUIBlock.GetIconUrl()|raw }}');"></div>
<img class="ibo-panel--icon-background ibo-panel--icon-img--must-{{ oUIBlock.GetIconCoverMethod() }}
ibo-panel--icon-background--must-{{ oUIBlock.GetIconCoverMethod() }}"
{% if oUIBlock.HasLazyLoadIcon %} loading="lazy" {% endif %}
data-role="ibo-panel--icon-img" src="{{ oUIBlock.GetIconUrl()|raw }}" alt="" aria-hidden="true">
{% endblock %}
</div>
{% endif %}

View File

@@ -230,7 +230,7 @@ class TestMyBizModel extends TestBizModel
public function test_error()
{
trigger_error("Stop requested", E_USER_ERROR);
trigger_error("Stop requested", E_USER_WARNING);
}
public function test_changetracking()

Some files were not shown because too many files have changed in this diff Show More