diff --git a/application/ajaxwebpage.class.inc.php b/application/ajaxwebpage.class.inc.php index 48ca3f3ee..486ecd4ee 100644 --- a/application/ajaxwebpage.class.inc.php +++ b/application/ajaxwebpage.class.inc.php @@ -1,12 +1,15 @@ AddCondition('objkey', $this->GetKey(), '='); @@ -1155,7 +1156,9 @@ HTML */ public static function GetDisplaySet(WebPage $oPage, DBObjectSet $oSet, $aExtraParams = array()) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use GetDisplaySetBlock'); $oPage->AddUiBlock(static::GetDisplaySetBlock($oPage, $oSet, $aExtraParams)); + return ""; } @@ -1191,11 +1194,10 @@ HTML */ public static function GetDisplayExtendedSet(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array()) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); if (empty($aExtraParams['currentId'])) { $iListId = utils::GetUniqueId(); // Works only if not in an Ajax page !! - } - else - { + } else { $iListId = $aExtraParams['currentId']; } $aList = array(); @@ -4279,23 +4281,19 @@ HTML; */ public function DisplayCaseLog(WebPage $oPage, $sAttCode, $sComment = '', $sPrefix = '', $bEditMode = false) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); $oPage->SetCurrentTab('UI:PropertiesTab'); $sClass = get_class($this); - if ($this->IsNew()) - { + if ($this->IsNew()) { $iFlags = $this->GetInitialStateAttributeFlags($sAttCode); - } - else - { + } else { $iFlags = $this->GetAttributeFlags($sAttCode); } - if ($iFlags & OPT_ATT_HIDDEN) - { + if ($iFlags & OPT_ATT_HIDDEN) { // The case log is hidden do nothing - } - else + } else { $oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode); $sAttDefClass = get_class($oAttDef); @@ -4381,9 +4379,9 @@ HTML */ public function GetExpectedAttributes($sCurrentState, $sStimulus, $bOnlyNewOnes) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Since iTop 2.4, use DBObject::GetTransitionAttributes() instead'); $aTransitions = $this->EnumTransitions(); - if (!isset($aTransitions[$sStimulus])) - { + if (!isset($aTransitions[$sStimulus])) { // Invalid stimulus throw new ApplicationException(Dict::Format('UI:Error:Invalid_Stimulus_On_Object_In_State', $sStimulus, $this->GetName(), $this->GetStateLabel())); diff --git a/application/csvpage.class.inc.php b/application/csvpage.class.inc.php index c0f96e7b3..10f1797fe 100644 --- a/application/csvpage.class.inc.php +++ b/application/csvpage.class.inc.php @@ -1,7 +1,8 @@ iListId = utils::GetSafeId($iListId); // Make a "safe" ID for jQuery $this->sDatatableContainerId = 'datatable_'.utils::GetSafeId($iListId); $this->oSet = $oSet; diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index b1284c217..363c2a1c4 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -1646,6 +1646,7 @@ class HistoryBlock extends DisplayBlock public function __construct(DBSearch $oFilter, $sStyle = 'list', $bAsynchronous = false, $aParams = array(), $oSet = null) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); parent::__construct($oFilter, $sStyle, $bAsynchronous, $aParams, $oSet); $this->iLimitStart = 0; $this->iLimitCount = 0; diff --git a/application/errorpage.class.inc.php b/application/errorpage.class.inc.php index 3fb638a0a..fffde3c92 100644 --- a/application/errorpage.class.inc.php +++ b/application/errorpage.class.inc.php @@ -1,7 +1,8 @@ AddToMenu(''); $oPage->AddToMenu('
'); @@ -418,13 +420,12 @@ EOF */ protected static function DisplaySubMenu($oPage, $aMenus, $aExtraParams, $iActiveMenu = -1) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use static::GetSubMenuNodes() instead'); // Sort the menu based on the rank $bActive = false; usort($aMenus, array('ApplicationMenu', 'CompareOnRank')); - foreach($aMenus as $aMenu) - { - if (!self::CanDisplayMenu($aMenu)) - { + foreach ($aMenus as $aMenu) { + if (!self::CanDisplayMenu($aMenu)) { continue; } $index = $aMenu['index']; diff --git a/application/nicewebpage.class.inc.php b/application/nicewebpage.class.inc.php index 27510f989..bc1f7f1c1 100644 --- a/application/nicewebpage.class.inc.php +++ b/application/nicewebpage.class.inc.php @@ -1,7 +1,8 @@ m_aTags = array ( + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + $this->m_aTags = array( 'itopblock', 'itopcheck', 'itoptabs', 'itoptab', 'itoptoggle', 'itopstring', - 'sqlblock' + 'sqlblock', ); $this->m_sTemplate = $sTemplate; } diff --git a/application/themehandler.class.inc.php b/application/themehandler.class.inc.php index 110b68345..d409ebe65 100644 --- a/application/themehandler.class.inc.php +++ b/application/themehandler.class.inc.php @@ -63,6 +63,7 @@ class ThemeHandler */ public static function GetCurrentThemeId() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); static::GetCurrentUserThemeId(); } diff --git a/application/webpage.class.inc.php b/application/webpage.class.inc.php index 28f1a35cc..d21581ad5 100644 --- a/application/webpage.class.inc.php +++ b/application/webpage.class.inc.php @@ -1,7 +1,8 @@ Get("compute_func"); - if (empty($sComputeFunc)) - { + if (empty($sComputeFunc)) { return null; } diff --git a/core/bulkexport.class.inc.php b/core/bulkexport.class.inc.php index d122d5422..b5152a95b 100644 --- a/core/bulkexport.class.inc.php +++ b/core/bulkexport.class.inc.php @@ -376,10 +376,11 @@ abstract class BulkExport } /** - * @deprecated since 3.0 replaced by GetFormPart + * @deprecated 3.0.0 use GetFormPart instead */ public function DisplayFormPart(WebPage $oP, $sPartId) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use GetFormPart instead'); $oP->AddSubBlock($this->GetFormPart($oP, $sPartId)); } diff --git a/core/cmdbobject.class.inc.php b/core/cmdbobject.class.inc.php index ed4c1e7a6..d15eef8cd 100644 --- a/core/cmdbobject.class.inc.php +++ b/core/cmdbobject.class.inc.php @@ -566,8 +566,8 @@ abstract class CMDBObject extends DBObject */ protected function CheckUserRights($bSkipStrongSecurity, $iActionCode) { - if (is_null($bSkipStrongSecurity)) - { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + if (is_null($bSkipStrongSecurity)) { // This is temporary // We have implemented this safety net right before releasing iTop 1.0 // and we decided that it was too risky to activate it diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 32f13ec11..e4273fd7c 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -4718,8 +4718,10 @@ abstract class DBObject implements iDisplay */ public function GetMasterReplica() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); $sOQL = "SELECT replica,datasource FROM SynchroReplica AS replica JOIN SynchroDataSource AS datasource ON replica.sync_source_id=datasource.id WHERE replica.dest_class = :dest_class AND replica.dest_id = :dest_id"; $oReplicaSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array() /* order by*/, array('dest_class' => get_class($this), 'dest_id' => $this->GetKey())); + return $oReplicaSet; } diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index d57d46e6f..78d6e8b36 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -280,62 +280,97 @@ abstract class DBSearch abstract public function TranslateConditions($aTranslationData, $bMatchAll = true, $bMarkFieldsAsResolved = true); - /** - * @internal - * @return mixed - */ + /** + * @internal + * @return mixed + */ abstract public function IsAny(); - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function Describe(){return 'deprecated - use ToOQL() instead';} - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function DescribeConditionPointTo($sExtKeyAttCode, $aPointingTo){return 'deprecated - use ToOQL() instead';} - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function DescribeConditionRefBy($sForeignClass, $sForeignExtKeyAttCode){return 'deprecated - use ToOQL() instead';} - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function DescribeConditionRelTo($aRelInfo){return 'deprecated - use ToOQL() instead';} - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function DescribeConditions(){return 'deprecated - use ToOQL() instead';} - /** - * @deprecated use ToOQL() instead - * @internal - * @return string - */ - public function __DescribeHTML(){return 'deprecated - use ToOQL() instead';} + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function Describe() + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); - /** - * @internal - * @return mixed - */ + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function DescribeConditionPointTo($sExtKeyAttCode, $aPointingTo) + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); + + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function DescribeConditionRefBy($sForeignClass, $sForeignExtKeyAttCode) + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); + + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function DescribeConditionRelTo($aRelInfo) + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); + + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function DescribeConditions() + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); + + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @deprecated use ToOQL() instead + * @return string + */ + public function __DescribeHTML() + { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ToOQL() instead'); + + return 'deprecated - use ToOQL() instead'; + } + + /** + * @internal + * @return mixed + */ abstract public function ResetCondition(); - /** - * add $oExpression as a OR - * - * @api - * @see DBSearch::AddConditionExpression() - * - * @param Expression $oExpression + /** + * add $oExpression as a OR + * + * @api + * @see DBSearch::AddConditionExpression() + * + * @param Expression $oExpression * * @return mixed */ diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 3073c5002..f392dbf56 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -1060,6 +1060,7 @@ abstract class MetaModel */ final public static function GetFilterCodeOrigin($sClass, $sAttCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); self::_check_subclass($sClass); return self::$m_aFilterOrigins[$sClass][$sAttCode]; @@ -1419,7 +1420,9 @@ abstract class MetaModel */ final public static function GetFiltersList($sClass) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); self::_check_subclass($sClass); + return array_keys(self::$m_aFilterDefs[$sClass]); } @@ -1526,6 +1529,7 @@ abstract class MetaModel */ final public static function IsValidFilterCode($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); if (!array_key_exists($sClass, self::$m_aFilterDefs)) { return false; } @@ -1837,7 +1841,9 @@ abstract class MetaModel */ public static function GetClassFilterDefs($sClass) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); self::_check_subclass($sClass); + return self::$m_aFilterDefs[$sClass]; } @@ -1852,6 +1858,7 @@ abstract class MetaModel */ final public static function GetClassFilterDef($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); self::_check_subclass($sClass); if (!array_key_exists($sFilterCode, self::$m_aFilterDefs[$sClass])) { throw new CoreException("Unknown filter code '$sFilterCode' for class '$sClass'"); @@ -1871,9 +1878,9 @@ abstract class MetaModel */ public static function GetFilterLabel($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $oFilter = self::GetClassFilterDef($sClass, $sFilterCode); - if ($oFilter) - { + if ($oFilter) { return $oFilter->GetLabel(); } @@ -1890,11 +1897,12 @@ abstract class MetaModel */ public static function GetFilterDescription($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $oFilter = self::GetClassFilterDef($sClass, $sFilterCode); - if ($oFilter) - { + if ($oFilter) { return $oFilter->GetDescription(); } + return ""; } @@ -1908,11 +1916,12 @@ abstract class MetaModel */ public static function GetFilterOperators($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $oFilter = self::GetClassFilterDef($sClass, $sFilterCode); - if ($oFilter) - { + if ($oFilter) { return $oFilter->GetOperators(); } + return array(); } @@ -1926,9 +1935,9 @@ abstract class MetaModel */ public static function GetFilterLooseOperator($sClass, $sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $oFilter = self::GetClassFilterDef($sClass, $sFilterCode); - if ($oFilter) - { + if ($oFilter) { return $oFilter->GetLooseOperator(); } @@ -1946,9 +1955,9 @@ abstract class MetaModel */ public static function GetFilterOpDescription($sClass, $sFilterCode, $sOpCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $oFilter = self::GetClassFilterDef($sClass, $sFilterCode); - if ($oFilter) - { + if ($oFilter) { return $oFilter->GetOpDescription($sOpCode); } @@ -1963,6 +1972,8 @@ abstract class MetaModel */ public static function GetFilterHTMLInput($sFilterCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); + return ""; } @@ -2137,24 +2148,21 @@ abstract class MetaModel */ public static function EnumRelations($sClass = '') { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Use EnumRelationsEx instead'); $aResult = array_keys(self::$m_aRelationInfos); - if (!empty($sClass)) - { + if (!empty($sClass)) { // Return only the relations that have a meaning (i.e. for which at least one query is defined) // for the specified class $aClassRelations = array(); - foreach($aResult as $sRelCode) - { + foreach ($aResult as $sRelCode) { $aQueriesDown = self::EnumRelationQueries($sClass, $sRelCode); - if (count($aQueriesDown) > 0) - { + if (count($aQueriesDown) > 0) { $aClassRelations[] = $sRelCode; } // Temporary patch: until the impact analysis GUI gets rewritten, // let's consider that "depends on" is equivalent to "impacts/up" // The current patch has been implemented in DBObject and MetaModel - if ($sRelCode == 'impacts') - { + if ($sRelCode == 'impacts') { $aQueriesUp = self::EnumRelationQueries($sClass, 'impacts', false); if (count($aQueriesUp) > 0) { @@ -5893,6 +5901,7 @@ abstract class MetaModel $aSugFix[$sClass]['*'][] = "DROP VIEW `$sView`"; } } + return array($aErrors, $aSugFix); } @@ -7118,6 +7127,8 @@ abstract class MetaModel */ public static function GetNextKey($sClass) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use ItopCounter::incRootClass($sClass) instead'); + return ItopCounter::IncClass($sClass); } @@ -7141,9 +7152,9 @@ abstract class MetaModel */ public static function BulkDelete(DBObjectSearch $oFilter) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); $sSQL = $oFilter->MakeDeleteQuery(); - if (!self::DBIsReadOnly()) - { + if (!self::DBIsReadOnly()) { CMDBSource::Query($sSQL); } } @@ -7160,12 +7171,13 @@ abstract class MetaModel */ public static function BulkUpdate(DBObjectSearch $oFilter, array $aValues) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('do not use : dead code, will be removed in the future'); // $aValues is an array of $sAttCode => $value $sSQL = $oFilter->MakeUpdateQuery($aValues); - if (!self::DBIsReadOnly()) - { + if (!self::DBIsReadOnly()) { CMDBSource::Query($sSQL); } + return CMDBSource::AffectedRows(); } diff --git a/core/oql/expression.class.inc.php b/core/oql/expression.class.inc.php index 8d611a31c..ff1070d23 100644 --- a/core/oql/expression.class.inc.php +++ b/core/oql/expression.class.inc.php @@ -117,6 +117,8 @@ abstract class Expression { */ public function Render(&$aArgs = null, $bRetrofitParams = false) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use RenderExpression'); + return $this->RenderExpression(false, $aArgs, $bRetrofitParams); } diff --git a/core/ormlinkset.class.inc.php b/core/ormlinkset.class.inc.php index cf8ce7fbe..07af2d506 100644 --- a/core/ormlinkset.class.inc.php +++ b/core/ormlinkset.class.inc.php @@ -153,7 +153,8 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator */ public function AddObject(DBObject $oObject, $sClassAlias = '') { - $this->AddItem($oObject); + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use \ormLinkSet::AddItem() instead'); + $this->AddItem($oObject); } /** @@ -258,16 +259,13 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator */ public function ToArray($bWithId = true) { - $aRet = array(); - foreach($this as $oItem) - { - if ($bWithId) - { - $aRet[$oItem->GetKey()] = $oItem; - } - else - { - $aRet[] = $oItem; + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use foreach($this as $oItem){} instead'); + $aRet = array(); + foreach ($this as $oItem) { + if ($bWithId) { + $aRet[$oItem->GetKey()] = $oItem; + } else { + $aRet[] = $oItem; } } return $aRet; diff --git a/core/valuesetdef.class.inc.php b/core/valuesetdef.class.inc.php index 57b327160..a9d553b72 100644 --- a/core/valuesetdef.class.inc.php +++ b/core/valuesetdef.class.inc.php @@ -128,11 +128,13 @@ class ValueSetObjects extends ValueSetDefinition } /** + * @deprecated use SetCondition instead + * * @param \DBSearch $oFilter - * @deprecated use SetCondition */ public function AddCondition(DBSearch $oFilter) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetCondition instead'); $this->SetCondition($oFilter); } diff --git a/datamodels/2.x/itop-backup/dbrestore.class.inc.php b/datamodels/2.x/itop-backup/dbrestore.class.inc.php index 36e96f6c5..c591412a4 100644 --- a/datamodels/2.x/itop-backup/dbrestore.class.inc.php +++ b/datamodels/2.x/itop-backup/dbrestore.class.inc.php @@ -111,6 +111,7 @@ class DBRestore extends DBBackup */ public function RestoreFromZip($sZipFile, $sEnvironment = 'production') { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Use RestoreFromCompressedBackup instead'); $this->RestoreFromCompressedBackup($sZipFile, $sEnvironment); } diff --git a/datamodels/2.x/itop-portal-base/portal/src/Helper/ApplicationHelper.php b/datamodels/2.x/itop-portal-base/portal/src/Helper/ApplicationHelper.php index c42aae84d..605af8efa 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Helper/ApplicationHelper.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Helper/ApplicationHelper.php @@ -24,6 +24,7 @@ use cmdbAbstractObject; use Combodo\iTop\Portal\Brick\AbstractBrick; use DBObjectSearch; use DBObjectSet; +use DeprecatedCallsLog; use Dict; use Exception; use IssueLog; @@ -60,6 +61,7 @@ class ApplicationHelper */ public static function LoadClasses($sScannedDir, $sFilePattern, $sType) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); @trigger_error( sprintf( 'Usage of legacy LoadClasses is deprecated. You should rely on autoloading (and therefore follow PSR4).', diff --git a/datamodels/2.x/itop-portal-base/portal/src/Helper/ContextManipulatorHelper.php b/datamodels/2.x/itop-portal-base/portal/src/Helper/ContextManipulatorHelper.php index 18b6c15ff..6f9fd1b6b 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Helper/ContextManipulatorHelper.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Helper/ContextManipulatorHelper.php @@ -26,6 +26,7 @@ use CorePortalInvalidActionRuleException; use DBObject; use DBObjectSet; use DBSearch; +use DeprecatedCallsLog; use DOMFormatException; use DOMNodeList; use Exception; @@ -443,15 +444,14 @@ class ContextManipulatorHelper */ public function GetCallbackUrls(array $aData, DBObject $oObject, $bModal = false) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Use navigation rules for form callbacks'); $aResults = array( 'submit' => null, 'cancel' => null, ); - if (isset($aData['rules'])) - { - foreach ($aData['rules'] as $sId) - { + if (isset($aData['rules'])) { + foreach ($aData['rules'] as $sId) { // Retrieving current rule $aRule = $this->GetRule($sId); diff --git a/datamodels/2.x/itop-portal-base/portal/src/Kernel.php b/datamodels/2.x/itop-portal-base/portal/src/Kernel.php index 02ad38496..f67bab16c 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Kernel.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Kernel.php @@ -19,13 +19,14 @@ namespace Combodo\iTop\Portal; -use utils; +use DeprecatedCallsLog; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\RouteCollectionBuilder; +use utils; /** * Class Kernel @@ -121,6 +122,7 @@ class Kernel extends BaseKernel */ public function isClassInActiveBundle($class) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); // TODO: Implement isClassInActiveBundle() method. } } diff --git a/datamodels/2.x/itop-sla-computation/main.itop-sla-computation.php b/datamodels/2.x/itop-sla-computation/main.itop-sla-computation.php index 1691b674d..e7b65e480 100755 --- a/datamodels/2.x/itop-sla-computation/main.itop-sla-computation.php +++ b/datamodels/2.x/itop-sla-computation/main.itop-sla-computation.php @@ -47,12 +47,11 @@ class SLAComputation implements iWorkingTimeComputer */ public static function SelectModule($sClassName) { - if (!class_exists($sClassName)) - { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + if (!class_exists($sClassName)) { throw new CoreException("Could not select this module, '$sClassName' in not a valid class name"); } - if (($sClassName != 'SLAComputationAddOnAPI') && !is_subclass_of($sClassName, 'SLAComputationAddOnAPI')) - { + if (($sClassName != 'SLAComputationAddOnAPI') && !is_subclass_of($sClassName, 'SLAComputationAddOnAPI')) { throw new CoreException("Could not select this module, the class '$sClassName' is not derived from SLAComputationAddOnAPI (parent class:".get_parent_class($sClassName)." )"); } self::$m_oAddOn = new $sClassName; @@ -143,6 +142,7 @@ class SLAComputationAddOnAPI */ public function Init() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); } /** diff --git a/pages/csvimport.php b/pages/csvimport.php index 44d8971f1..81be017ee 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -58,6 +58,7 @@ try { */ function GetClassesSelect($sName, $sDefaultValue, $iWidthPx, $iActionCode = null) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use GetClassesSelectUIBlock'); $oSelectBlock = GetClassesSelectUIBlock($sName, $sDefaultValue, $iActionCode); return BlockRenderer::RenderBlockTemplates($oSelectBlock); diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 63830d789..e5c9f1310 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -994,6 +994,8 @@ class ModelFactory */ function HasLoadErrors() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Errors are now sent by Exception'); + return (count(self::$aLoadErrors) > 0); } @@ -1003,6 +1005,8 @@ class ModelFactory */ function GetLoadErrors() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('Errors are now sent by Exception'); + return self::$aLoadErrors; } diff --git a/setup/setuppage.class.inc.php b/setup/setuppage.class.inc.php index a356ca7d9..fdefabf89 100644 --- a/setup/setuppage.class.inc.php +++ b/setup/setuppage.class.inc.php @@ -172,6 +172,7 @@ class SetupPage extends NiceWebPage */ public static function log_error($sText) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetupLog::Error'); SetupLog::Error($sText); } @@ -180,6 +181,7 @@ class SetupPage extends NiceWebPage */ public static function log_warning($sText) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetupLog::Warning'); SetupLog::Warning($sText); } @@ -188,6 +190,7 @@ class SetupPage extends NiceWebPage */ public static function log_info($sText) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetupLog::Info'); SetupLog::Info($sText); } @@ -196,6 +199,7 @@ class SetupPage extends NiceWebPage */ public static function log_ok($sText) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetupLog::Ok'); SetupLog::Ok($sText); } @@ -204,6 +208,7 @@ class SetupPage extends NiceWebPage */ public static function log($sText) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use SetupLog::Ok'); SetupLog::Ok($sText); } diff --git a/sources/application/WebPage/AjaxPage.php b/sources/application/WebPage/AjaxPage.php index f2bd1a79e..82a77050b 100644 --- a/sources/application/WebPage/AjaxPage.php +++ b/sources/application/WebPage/AjaxPage.php @@ -133,6 +133,7 @@ class AjaxPage extends WebPage implements iTabbedPage */ public function AddToMenu($sHtml) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); $this->m_sMenu .= $sHtml; } diff --git a/sources/application/WebPage/TabManager.php b/sources/application/WebPage/TabManager.php index 52284e8ac..d1d47fcf3 100644 --- a/sources/application/WebPage/TabManager.php +++ b/sources/application/WebPage/TabManager.php @@ -5,7 +5,6 @@ */ use Combodo\iTop\Application\UI\Base\iUIBlock; -use Combodo\iTop\Application\UI\Base\Layout\TabContainer\Tab\AjaxTab; use Combodo\iTop\Application\UI\Base\Layout\TabContainer\Tab\Tab; use Combodo\iTop\Application\UI\Base\Layout\TabContainer\TabContainer; @@ -82,6 +81,8 @@ class TabManager */ public function GetCurrentTabLength() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + return 0; } @@ -97,6 +98,8 @@ class TabManager */ public function TruncateTab(string $sTabContainer, string $sTab, int $iLength) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + return ''; } @@ -293,6 +296,8 @@ class TabManager */ public function SelectTab(string $sTabContainer, string $sTabCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + return ''; } @@ -305,6 +310,8 @@ class TabManager */ public function RenderIntoContent(string $sContent, WebPage $oPage) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); + return ''; } diff --git a/sources/application/WebPage/WebPage.php b/sources/application/WebPage/WebPage.php index 7576ff1e4..d660ca932 100644 --- a/sources/application/WebPage/WebPage.php +++ b/sources/application/WebPage/WebPage.php @@ -1193,6 +1193,8 @@ class WebPage implements Page */ public function GetUniqueId() { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use utils::GetUniqueId() instead'); + return utils::GetUniqueId(); } @@ -1465,7 +1467,8 @@ EOD */ public function StartCollapsibleSection($sSectionLabel, $bOpenedByDefault = false, $sSectionStateStorageBusinessKey = '') { - $this->add($this->GetStartCollapsibleSection($sSectionLabel, $bOpenedByDefault, $sSectionStateStorageBusinessKey)); + DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use \\Combodo\\iTop\\Application\\UI\\Base\\Component\\CollapsibleSection\\CollapsibleSection'); + $this->add($this->GetStartCollapsibleSection($sSectionLabel, $bOpenedByDefault, $sSectionStateStorageBusinessKey)); } /** diff --git a/sources/application/WebPage/iTopWebPage.php b/sources/application/WebPage/iTopWebPage.php index fb3ea042a..2c04a3053 100644 --- a/sources/application/WebPage/iTopWebPage.php +++ b/sources/application/WebPage/iTopWebPage.php @@ -1046,6 +1046,7 @@ EOF */ public function SelectTab($sTabContainer, $sTabCode) { + DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); $this->add_ready_script($this->m_oTabs->SelectTab($sTabContainer, $sTabCode)); }