Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions application/cmdbabstract.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6037,7 +6037,7 @@ final protected function FireEventUnArchive(): void
* @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] = [];
Expand All @@ -6060,7 +6060,7 @@ final public function AddAttributeFlags(string $sAttCode, int $iFlags, string $s
* @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] = [];
Expand Down Expand Up @@ -6101,7 +6101,7 @@ final protected function GetExtensionsAttributeFlags(string $sAttCode, array &$a
* @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 = [];
Expand All @@ -6123,7 +6123,7 @@ final public function AddInitialAttributeFlags(string $sAttCode, int $iFlags, st
* @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 = [];
Expand Down
4 changes: 2 additions & 2 deletions application/newsroomprovider.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function SetConfig(Config $oConfig);
* @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
Expand Down Expand Up @@ -139,7 +139,7 @@ abstract public function GetMarkAllAsReadURL();
*/
abstract public function GetViewAllURL();

public function IsApplicable(User $oUser = null)
public function IsApplicable(?User $oUser = null)
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions application/query.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function GetAttributeFlags($sAttCode, &$aReasons = [], $sTargetState = ''
* @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.
Expand Down Expand Up @@ -227,7 +227,7 @@ public static function Init()
}

/** @inheritdoc */
public function GetExportUrl(array $aValues = null): ?string
public function GetExportUrl(?array $aValues = null): ?string
{
try {
// retrieve attributes
Expand Down
4 changes: 2 additions & 2 deletions application/utils.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ public static function DebugBacktrace($iLimit = 5)
* @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)) {
Expand Down Expand Up @@ -1374,7 +1374,7 @@ public static function GetDataPath(): string
* @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();
Expand Down
48 changes: 24 additions & 24 deletions core/attributedef.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ public function MakeValue()
return call_user_func($sComputeFunc);
}

abstract public function GetDefaultValue(DBObject $oHostObject = null);
abstract public function GetDefaultValue(?DBObject $oHostObject = null);

//
// To be overloaded in subclasses
Expand Down Expand Up @@ -1476,7 +1476,7 @@ public function GetEditClass()
return "";
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
Expand Down Expand Up @@ -1622,7 +1622,7 @@ public function GetPrerequisiteAttributes($sClass = null)
* @throws \CoreException
* @throws \CoreWarning
*/
public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
if ($oHostObject === null) {
return null;
Expand Down Expand Up @@ -2639,7 +2639,7 @@ public function GetSQLExpr()
return $this->Get("sql");
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->MakeRealValue("", $oHostObject);
}
Expand Down Expand Up @@ -2728,7 +2728,7 @@ public static function ListExpectedParams()
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);
}
Expand Down Expand Up @@ -2917,7 +2917,7 @@ protected function GetSQLCol($bFullSpec = false)
return "INT(11)".($bFullSpec ? " DEFAULT 0" : "");
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return 0;
}
Expand Down Expand Up @@ -3649,7 +3649,7 @@ public function __construct($sCode, $aParams)
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)) {
Expand Down Expand Up @@ -3843,7 +3843,7 @@ public function SetFixedValue($sValue)
$this->m_sValue = $sValue;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->m_sValue;
}
Expand Down Expand Up @@ -4730,7 +4730,7 @@ public function GetAsPlainText($value, $oHostObj = null)
}
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormCaseLog();
}
Expand Down Expand Up @@ -6128,7 +6128,7 @@ public static function GetAsUnixSeconds($value)
return $iUnixSeconds;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$sDefaultValue = $this->Get('default_value');
if (utils::IsNotNullOrEmptyString($sDefaultValue)) {
Expand Down Expand Up @@ -6812,7 +6812,7 @@ public function GetDisplayStyle()
return $this->GetOptional('display_style', 'select');
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return 0;
}
Expand Down Expand Up @@ -7547,7 +7547,7 @@ public function GetSQLExpr()
return $oExtAttDef->GetSQLExpr();
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$oExtAttDef = $this->GetExtAttDef();

Expand Down Expand Up @@ -7910,12 +7910,12 @@ public function IsWritable()
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);
}
Expand Down Expand Up @@ -8295,7 +8295,7 @@ public function MakeRealValue($proposedValue, $oHostObj)
return $oDoc;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormDocument('', '', '');
}
Expand Down Expand Up @@ -8481,7 +8481,7 @@ public function IsWritable()
return true;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->NewStopWatch();
}
Expand Down Expand Up @@ -9348,7 +9348,7 @@ public function IsWritable()
return false;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
Expand Down Expand Up @@ -9566,7 +9566,7 @@ public function IsWritable()
return true;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return "";
}
Expand Down Expand Up @@ -10146,7 +10146,7 @@ public function RequiresFullTextIndex()
return true;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return null;
}
Expand Down Expand Up @@ -11359,7 +11359,7 @@ public function GetNullValue()
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([]);
Expand Down Expand Up @@ -11867,7 +11867,7 @@ public function SetFixedValue($sValue)
$this->m_sValue = $sValue;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->m_sValue;
}
Expand Down Expand Up @@ -12030,7 +12030,7 @@ public function GetMaxSize()
return 20;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
$sRet = 'disabled';
if ($this->Get('enabled')) {
Expand Down Expand Up @@ -12466,7 +12466,7 @@ public static function LoadFromClassTables()
return false;
} // See ReadValue...

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return new ormCustomFieldsValue($oHostObject, $this->GetCode());
}
Expand Down Expand Up @@ -13053,7 +13053,7 @@ public function GetSQLExpr()
return null;
}

public function GetDefaultValue(DBObject $oHostObject = null)
public function GetDefaultValue(?DBObject $oHostObject = null)
{
return $this->MakeRealValue(false, $oHostObject);
}
Expand Down
10 changes: 5 additions & 5 deletions core/bulkchange.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -873,7 +873,7 @@ protected function PrepareMissingObject(&$oTargetObj, &$aErrors)
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);

Expand Down Expand Up @@ -962,7 +962,7 @@ protected function CreateObject(&$aResult, $iRow, $aRowData, CMDBChange $oChange
* @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);

Expand Down Expand Up @@ -1005,7 +1005,7 @@ protected function UpdateObject(&$aResult, $iRow, $oTargetObj, $aRowData, CMDBCh
*
* @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);

Expand Down Expand Up @@ -1040,7 +1040,7 @@ protected function UpdateMissingObject(&$aResult, $iRow, $oTargetObj, CMDBChange
}
}

public function Process(CMDBChange $oChange = null)
public function Process(?CMDBChange $oChange = null)
{
if ($oChange) {
CMDBObject::SetCurrentChange($oChange);
Expand Down
4 changes: 2 additions & 2 deletions core/dbobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ final public function CheckToWrite($bDoComputeValues = true)
*
* @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) {
Expand Down Expand Up @@ -3729,7 +3729,7 @@ protected function PostUpdateActions(array $aChanges): void
* @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;
Expand Down
2 changes: 1 addition & 1 deletion core/dbsearch.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ public static function FromOQL_AllData($sQuery, $aParams = null)
*
* @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;
Expand Down
4 changes: 2 additions & 2 deletions core/designdocument.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public function _FindChildNodes(DesignElement $oRefNode): ?DesignElement
* @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) {
Expand All @@ -477,7 +477,7 @@ public static function _FindNode(DOMNode $oParent, DesignElement $oRefNode, stri
* @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;
Expand Down
Loading