N°8796 - Add PHP code style validation in iTop and extensions - format whole code base

This commit is contained in:
odain
2025-11-07 15:39:53 +01:00
parent 12f23113f5
commit 890a2568c8
2110 changed files with 53099 additions and 63885 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('CS CZ', 'Czech', 'Čeština', array(
Dict::Add('CS CZ', 'Czech', 'Čeština', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('DA DA', 'Danish', 'Dansk', array(
Dict::Add('DA DA', 'Danish', 'Dansk', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('DE DE', 'German', 'Deutsch', array(
Dict::Add('DE DE', 'German', 'Deutsch', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -21,6 +22,6 @@
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('EN US', 'English', 'English', array(
Dict::Add('EN US', 'English', 'English', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -21,6 +22,6 @@
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('EN GB', 'British English', 'British English', array(
Dict::Add('EN GB', 'British English', 'British English', [
// Dictionary entries go here
));
]);

View File

@@ -1,12 +1,13 @@
<?php
/**
* Spanish Localized data
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
* @author Miguel Turrubiates <miguel_tf@yahoo.com>
* @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
* @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
*/
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('FR FR', 'French', 'Français', array(
Dict::Add('FR FR', 'French', 'Français', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
Dict::Add('HU HU', 'Hungarian', 'Magyar', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('IT IT', 'Italian', 'Italiano', array(
Dict::Add('IT IT', 'Italian', 'Italiano', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('JA JP', 'Japanese', '日本語', array(
Dict::Add('JA JP', 'Japanese', '日本語', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
Dict::Add('NL NL', 'Dutch', 'Nederlands', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('PL PL', 'Polish', 'Polski', array(
Dict::Add('PL PL', 'Polish', 'Polski', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
// Dictionary entries go here
));
]);

View File

@@ -1,15 +1,16 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
*
*
*/
/**
* @author Vladimir Kunin <v.b.kunin@gmail.com>
*
*/
Dict::Add('RU RU', 'Russian', 'Русский', array(
Dict::Add('RU RU', 'Russian', 'Русский', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
Dict::Add('TR TR', 'Turkish', 'Türkçe', [
// Dictionary entries go here
));
]);

View File

@@ -1,4 +1,5 @@
<?php
/**
* Localized data
*
@@ -20,6 +21,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with iTop. If not, see <http://www.gnu.org/licenses/>
*/
Dict::Add('ZH CN', 'Chinese', '简体中文', array(
Dict::Add('ZH CN', 'Chinese', '简体中文', [
// Dictionary entries go here
));
]);

View File

@@ -1,9 +1,10 @@
<?php
// Copyright (C) 2010-2024 Combodo SAS
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
@@ -16,7 +17,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Module itop-sla-computation: implements an extensible mechanism
*
@@ -55,7 +55,7 @@ class SLAComputation implements iWorkingTimeComputer
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;
self::$m_oAddOn = new $sClassName();
self::$m_oAddOn->Init();
}
@@ -87,13 +87,11 @@ class SLAComputation implements iWorkingTimeComputer
*/
public function GetDeadline($oObject, $iDuration, DateTime $oStartDate)
{
if (class_exists('WorkingTimeRecorder'))
{
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::Trace(WorkingTimeRecorder::TRACE_DEBUG, __class__.'::'.__function__);
}
$oEndDate = self::$m_oAddOn->GetDeadline($oObject, $iDuration, $oStartDate);
if (class_exists('WorkingTimeRecorder'))
{
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::SetValues($oStartDate->format('U'), $oEndDate->format('U'), $iDuration, WorkingTimeRecorder::COMPUTED_END);
}
@@ -112,15 +110,17 @@ class SLAComputation implements iWorkingTimeComputer
*/
public function GetOpenDuration($oObject, DateTime $oStartDate, DateTime $oEndDate)
{
if (class_exists('WorkingTimeRecorder'))
{
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::Trace(WorkingTimeRecorder::TRACE_DEBUG, __class__.'::'.__function__);
}
$iDuration = self::$m_oAddOn->GetOpenDuration($oObject, $oStartDate, $oEndDate);
if (class_exists('WorkingTimeRecorder'))
{
WorkingTimeRecorder::SetValues($oStartDate->format('U'), $oEndDate->format('U'), $iDuration,
WorkingTimeRecorder::COMPUTED_DURATION);
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::SetValues(
$oStartDate->format('U'),
$oEndDate->format('U'),
$iDuration,
WorkingTimeRecorder::COMPUTED_DURATION
);
}
return $iDuration;
@@ -159,8 +159,7 @@ class SLAComputationAddOnAPI
*/
public static function GetDeadline($oTicket, $iDuration, DateTime $oStartDate)
{
if (class_exists('WorkingTimeRecorder'))
{
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::Trace(WorkingTimeRecorder::TRACE_DEBUG, __class__.'::'.__function__);
}
// Default implementation: 24x7, no holidays: to compute the deadline, just add
@@ -182,8 +181,7 @@ class SLAComputationAddOnAPI
*/
public static function GetOpenDuration($oTicket, DateTime $oStartDate, DateTime $oEndDate)
{
if (class_exists('WorkingTimeRecorder'))
{
if (class_exists('WorkingTimeRecorder')) {
WorkingTimeRecorder::Trace(WorkingTimeRecorder::TRACE_DEBUG, __class__.'::'.__function__);
}

View File

@@ -1,9 +1,10 @@
<?php
// Copyright (C) 2010-2024 Combodo SAS
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
@@ -19,7 +20,7 @@
SetupWebPage::AddModule(
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
'itop-sla-computation/3.2.1',
array(
[
// Identification
//
'label' => 'SLA Computation',
@@ -27,36 +28,36 @@ SetupWebPage::AddModule(
// Setup
//
'dependencies' => array(
),
'dependencies' => [
],
'mandatory' => true,
'visible' => false,
// Components
//
'datamodel' => array(
'datamodel' => [
'main.itop-sla-computation.php',
),
'webservice' => array(
),
'data.struct' => array(
],
'webservice' => [
],
'data.struct' => [
// add your 'structure' definition XML files here,
),
'data.sample' => array(
],
'data.sample' => [
// add your sample data XML files here,
),
],
// Documentation
//
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
'doc.more_information' => '', // hyperlink to more information, if any
'doc.more_information' => '', // hyperlink to more information, if any
// Default settings
//
'settings' => array(
'settings' => [
// Module specific settings go here, if any
),
)
],
]
);