PHPDoc & code cleanup

This commit is contained in:
Molkobain
2020-08-18 22:35:59 +02:00
parent 2ce1c2efec
commit 8077e5aa62

View File

@@ -77,7 +77,7 @@ class CMDBChangeOp extends DBObject implements iCMDBChangeOp
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -98,8 +98,6 @@ class CMDBChangeOp extends DBObject implements iCMDBChangeOp
}
}
/**
* Record the creation of an object
*
@@ -107,6 +105,9 @@ class CMDBChangeOp extends DBObject implements iCMDBChangeOp
*/
class CMDBChangeOpCreate extends CMDBChangeOp
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -125,7 +126,7 @@ class CMDBChangeOpCreate extends CMDBChangeOp
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -133,7 +134,6 @@ class CMDBChangeOpCreate extends CMDBChangeOp
}
}
/**
* Record the deletion of an object
*
@@ -141,6 +141,9 @@ class CMDBChangeOpCreate extends CMDBChangeOp
*/
class CMDBChangeOpDelete extends CMDBChangeOp
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -162,8 +165,9 @@ class CMDBChangeOpDelete extends CMDBChangeOp
// Last friendly name of the object
MetaModel::Init_AddAttribute(new AttributeString("fname", array("allowed_values"=>null, "sql"=>"fname", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -188,6 +192,9 @@ interface iCMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttribute extends CMDBChangeOp implements iCMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -218,6 +225,9 @@ class CMDBChangeOpSetAttribute extends CMDBChangeOp implements iCMDBChangeOpSetA
*/
class CMDBChangeOpSetAttributeScalar extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -242,7 +252,7 @@ class CMDBChangeOpSetAttributeScalar extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -274,7 +284,10 @@ class CMDBChangeOpSetAttributeScalar extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeTagSet extends CMDBChangeOpSetAttribute
{
public static function Init()
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
(
@@ -297,10 +310,10 @@ class CMDBChangeOpSetAttributeTagSet extends CMDBChangeOpSetAttribute
MetaModel::Init_SetZListItems('list', array('date', 'userinfo', 'attcode', 'oldvalue', 'newvalue')); // Attributes to be displayed for a list
}
/**
* Describe (as a text string) the modifications corresponding to this change
*/
public function GetDescription()
/**
* @inheritDoc
*/
public function GetDescription()
{
$sResult = '';
$sTargetObjectClass = $this->Get('objclass');
@@ -331,6 +344,9 @@ class CMDBChangeOpSetAttributeTagSet extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeURL extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -355,7 +371,7 @@ class CMDBChangeOpSetAttributeURL extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -387,6 +403,9 @@ class CMDBChangeOpSetAttributeURL extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeBlob extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -410,7 +429,7 @@ class CMDBChangeOpSetAttributeBlob extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -454,11 +473,15 @@ class CMDBChangeOpSetAttributeBlob extends CMDBChangeOpSetAttribute
return $sResult;
}
}
/**
* Safely record the modification of one way encrypted password
*/
class CMDBChangeOpSetAttributeOneWayPassword extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -482,7 +505,7 @@ class CMDBChangeOpSetAttributeOneWayPassword extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -519,6 +542,9 @@ class CMDBChangeOpSetAttributeOneWayPassword extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeEncrypted extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -542,7 +568,7 @@ class CMDBChangeOpSetAttributeEncrypted extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -582,6 +608,9 @@ class CMDBChangeOpSetAttributeEncrypted extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeText extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -605,7 +634,7 @@ class CMDBChangeOpSetAttributeText extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -647,6 +676,9 @@ class CMDBChangeOpSetAttributeText extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeLongText extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -670,7 +702,7 @@ class CMDBChangeOpSetAttributeLongText extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -709,6 +741,9 @@ class CMDBChangeOpSetAttributeLongText extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeHTML extends CMDBChangeOpSetAttributeLongText
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -729,8 +764,9 @@ class CMDBChangeOpSetAttributeHTML extends CMDBChangeOpSetAttributeLongText
MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'attcode')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('list', array('date', 'userinfo', 'attcode')); // Attributes to be displayed for a list
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -772,6 +808,9 @@ class CMDBChangeOpSetAttributeHTML extends CMDBChangeOpSetAttributeLongText
*/
class CMDBChangeOpSetAttributeCaseLog extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -795,7 +834,7 @@ class CMDBChangeOpSetAttributeCaseLog extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -830,6 +869,11 @@ class CMDBChangeOpSetAttributeCaseLog extends CMDBChangeOpSetAttribute
return $sResult;
}
/**
* @param string $sRawText
*
* @return string
*/
protected function ToHtml($sRawText)
{
return str_replace(array("\r\n", "\n", "\r"), "<br/>", htmlentities($sRawText, ENT_QUOTES, 'UTF-8'));
@@ -843,6 +887,9 @@ class CMDBChangeOpSetAttributeCaseLog extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpPlugin extends CMDBChangeOp
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -866,7 +913,7 @@ class CMDBChangeOpPlugin extends CMDBChangeOp
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -881,6 +928,9 @@ class CMDBChangeOpPlugin extends CMDBChangeOp
*/
abstract class CMDBChangeOpSetAttributeLinks extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -911,6 +961,9 @@ abstract class CMDBChangeOpSetAttributeLinks extends CMDBChangeOpSetAttribute
*/
class CMDBChangeOpSetAttributeLinksAddRemove extends CMDBChangeOpSetAttributeLinks
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -931,7 +984,7 @@ class CMDBChangeOpSetAttributeLinksAddRemove extends CMDBChangeOpSetAttributeLin
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -975,6 +1028,9 @@ class CMDBChangeOpSetAttributeLinksAddRemove extends CMDBChangeOpSetAttributeLin
*/
class CMDBChangeOpSetAttributeLinksTune extends CMDBChangeOpSetAttributeLinks
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -995,7 +1051,7 @@ class CMDBChangeOpSetAttributeLinksTune extends CMDBChangeOpSetAttributeLinks
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{
@@ -1062,6 +1118,9 @@ class CMDBChangeOpSetAttributeLinksTune extends CMDBChangeOpSetAttributeLinks
*/
class CMDBChangeOpSetAttributeCustomFields extends CMDBChangeOpSetAttribute
{
/**
* @inheritDoc
*/
public static function Init()
{
$aParams = array
@@ -1085,7 +1144,7 @@ class CMDBChangeOpSetAttributeCustomFields extends CMDBChangeOpSetAttribute
}
/**
* Describe (as a text string) the modifications corresponding to this change
* @inheritDoc
*/
public function GetDescription()
{