mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8699 - attributedef.class.inc.php to PSR4 [3-PSR4]
- Add namespaces - Add use statements - reformat code
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Core\AttributeDefinition;
|
||||
|
||||
/**
|
||||
* Specialization of a string: IP address
|
||||
@@ -7,33 +13,33 @@
|
||||
*/
|
||||
class AttributeIPAddress extends AttributeString
|
||||
{
|
||||
/**
|
||||
* Useless constructor, but if not present PHP 7.4.0/7.4.1 is crashing :( (N°2329)
|
||||
*
|
||||
* @see https://www.php.net/manual/fr/language.oop5.decon.php states that child constructor can be ommited
|
||||
* @see https://bugs.php.net/bug.php?id=79010 bug solved in PHP 7.4.9
|
||||
*
|
||||
* @param string $sCode
|
||||
* @param array $aParams
|
||||
*
|
||||
* @throws \Exception
|
||||
* @noinspection SenselessProxyMethodInspection
|
||||
*/
|
||||
public function __construct($sCode, $aParams)
|
||||
{
|
||||
parent::__construct($sCode, $aParams);
|
||||
}
|
||||
/**
|
||||
* Useless constructor, but if not present PHP 7.4.0/7.4.1 is crashing :( (N°2329)
|
||||
*
|
||||
* @see https://www.php.net/manual/fr/language.oop5.decon.php states that child constructor can be ommited
|
||||
* @see https://bugs.php.net/bug.php?id=79010 bug solved in PHP 7.4.9
|
||||
*
|
||||
* @param string $sCode
|
||||
* @param array $aParams
|
||||
*
|
||||
* @throws Exception
|
||||
* @noinspection SenselessProxyMethodInspection
|
||||
*/
|
||||
public function __construct($sCode, $aParams)
|
||||
{
|
||||
parent::__construct($sCode, $aParams);
|
||||
}
|
||||
|
||||
public function GetValidationPattern()
|
||||
{
|
||||
$sNum = '(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])';
|
||||
public function GetValidationPattern()
|
||||
{
|
||||
$sNum = '(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])';
|
||||
|
||||
return "^($sNum\\.$sNum\\.$sNum\\.$sNum)$";
|
||||
}
|
||||
return "^($sNum\\.$sNum\\.$sNum\\.$sNum)$";
|
||||
}
|
||||
|
||||
public function GetOrderBySQLExpressions($sClassAlias)
|
||||
{
|
||||
// Note: This is the responsibility of this function to place backticks around column aliases
|
||||
return array('INET_ATON(`' . $sClassAlias . $this->GetCode() . '`)');
|
||||
}
|
||||
public function GetOrderBySQLExpressions($sClassAlias)
|
||||
{
|
||||
// Note: This is the responsibility of this function to place backticks around column aliases
|
||||
return array('INET_ATON(`'.$sClassAlias.$this->GetCode().'`)');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user