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
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
@@ -6,7 +7,6 @@
namespace Combodo\iTop\Application\UI\Base\Component\Input;
use Combodo\iTop\Application\UI\Base\UIBlock;
/**
@@ -76,4 +76,4 @@ abstract class AbstractInput extends UIBlock
return $this;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\FileSelect;
use Combodo\iTop\Application\UI\Base\UIBlock;
use Dict;
@@ -103,5 +102,5 @@ class FileSelect extends UIBlock
{
return $this->bShowFilename;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\FileSelect;
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
/**
@@ -36,4 +35,4 @@ class FileSelectUIBlockFactory extends AbstractUIBlockFactory
{
return new FileSelect($sName, $sId);
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
@@ -6,7 +7,6 @@
namespace Combodo\iTop\Application\UI\Base\Component\Input;
/**
* Class Input
*
@@ -21,7 +21,7 @@ class Input extends AbstractInput
public const INPUT_HIDDEN = 'hidden';
protected $bIsChecked = false;
protected $bIsDisabled = false;
protected $bIsReadonly = false;
@@ -128,4 +128,4 @@ class Input extends AbstractInput
{
return !is_null($this->sLabel);
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input;
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Field\Field;
@@ -78,10 +77,12 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
* @return \Combodo\iTop\Application\UI\Base\Component\Input\InputWithLabel
*/
public static function MakeForInputWithLabel(
string $sLabel, string $sInputName, ?string $sInputValue = null,
?string $sInputId = null, string $sInputType = 'type'
)
{
string $sLabel,
string $sInputName,
?string $sInputValue = null,
?string $sInputId = null,
string $sInputType = 'type'
) {
$oInput = new Input($sInputId);
$oInput->SetType($sInputType);
$oInput->SetValue($sInputValue);
@@ -109,4 +110,4 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
return new InputWithLabel($sLabel, $oInput, $sId);
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input;
use Combodo\iTop\Application\UI\Base\UIBlock;
use utils;
@@ -142,4 +141,4 @@ class InputWithLabel extends UIBlock
{
return [$this->oInput->GetId() => $this->oInput];
}
}
}

View File

@@ -1,9 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\RichText;
use Combodo\iTop\Application\Helper\CKEditorHelper;
use Combodo\iTop\Application\Helper\WebResourcesHelper;
use Combodo\iTop\Application\UI\Base\UIBlock;
@@ -83,7 +86,7 @@ class RichText extends UIBlock
public function SetValue(?string $sValue)
{
$this->sValue = $sValue;
if(is_array($this->aConfig)) {
if (is_array($this->aConfig)) {
$this->aConfig['detectChanges'] = ['initialValue' => $sValue];
}
@@ -111,4 +114,4 @@ class RichText extends UIBlock
{
return $this->aConfig;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\Select;
use Combodo\iTop\Application\UI\Base\Component\Input\tInputLabel;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
@@ -26,7 +25,6 @@ class Select extends UIContentBlock
/** @var bool Allow multiple selection */
protected $bIsMultiple = false;
public function __construct(?string $sId = null)
{
parent::__construct($sId);
@@ -95,4 +93,4 @@ class Select extends UIContentBlock
return $this;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\Select;
use Combodo\iTop\Application\UI\Base\UIBlock;
class SelectOption extends UIBlock
@@ -80,8 +79,8 @@ class SelectOption extends UIBlock
{
$this->bSelected = $bSelected;
return $this;
}
}
/**
* @return bool
*/
@@ -101,4 +100,4 @@ class SelectOption extends UIBlock
return $this;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\Select;
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
/**
@@ -45,4 +44,4 @@ class SelectOptionUIBlockFactory extends AbstractUIBlockFactory
return $oInput;
}
}
}

View File

@@ -1,13 +1,12 @@
<?php
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\Select;
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
@@ -64,4 +63,4 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory
return $oInput;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -156,5 +157,4 @@ abstract class AbstractDataProvider implements iDataProvider
return $this->GetType() === iDataProvider::TYPE_SIMPLE_PROVIDER;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -28,7 +29,7 @@ namespace Combodo\iTop\Application\UI\Base\Component\Input\Set\DataProvider;
class AjaxDataProvider extends SimpleDataProvider
{
/** @var int DEFAULT_MAX_RESULTS maximum results fetched */
const DEFAULT_MAX_RESULTS = 25;
public const DEFAULT_MAX_RESULTS = 25;
/**
* @see \Combodo\iTop\Service\Router\Router
@@ -45,7 +46,6 @@ class AjaxDataProvider extends SimpleDataProvider
/** @var int $iMaxResults Maximum entries */
private int $iMaxResults = AjaxDataProvider::DEFAULT_MAX_RESULTS;
/**
* Constructor.
*
@@ -166,4 +166,4 @@ class AjaxDataProvider extends SimpleDataProvider
return $this->iMaxResults;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -27,7 +28,6 @@ namespace Combodo\iTop\Application\UI\Base\Component\Input\Set\DataProvider;
*/
class AjaxDataProviderForOQL extends AjaxDataProvider
{
/**
* Constructor.
*
@@ -62,4 +62,4 @@ class AjaxDataProviderForOQL extends AjaxDataProvider
->SetDataSearchFields(['friendlyname', 'additional_field']);
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -92,4 +93,4 @@ class SimpleDataProvider extends AbstractDataProvider
return array_values($aGroups);
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -142,4 +143,4 @@ interface iDataProvider
* @return $this
*/
public function SetTooltipField(string $sField): iDataProvider;
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -54,7 +55,6 @@ class Set extends AbstractInput
private ?int $iMinItems;
/** @var int|null $iMaxItem Maximum number of displayed options */
private ?int $iMaxOptions;
@@ -608,4 +608,4 @@ class Set extends AbstractInput
$this->bIsDisabled = $bIsDisabled;
return $this;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -157,4 +158,4 @@ class SetUIBlockFactory extends AbstractUIBlockFactory
return $oSetUIBlock;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
@@ -6,7 +7,6 @@
namespace Combodo\iTop\Application\UI\Base\Component\Input;
/**
* @package Combodo\iTop\Application\UI\Base\Component\Input
*/
@@ -88,5 +88,4 @@ class TextArea extends AbstractInput
return $this;
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
@@ -6,25 +7,23 @@
namespace Combodo\iTop\Application\UI\Base\Component\Input;
/**
* @package Combodo\iTop\Application\UI\Base\Component\Input
* @since 3.2.0
*/
class Toggler extends Input {
class Toggler extends Input
{
// Overloaded constants
public const BLOCK_CODE = 'ibo-toggler';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/input/input-toggler';
public const DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH = 'base/components/input/input-toggler';
public function __construct(?string $sId = null)
{
parent::__construct($sId);
$this->SetType('checkbox');
}
public function SetIsToggled(bool $bIsToggled): static
{
return $this->SetIsChecked($bIsToggled);
@@ -34,4 +33,4 @@ class Toggler extends Input {
{
return $this->IsChecked();
}
}
}

View File

@@ -1,10 +1,10 @@
<?php
/**
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input;
use utils;
@@ -122,4 +122,4 @@ trait tInputLabel
{
return utils::StrLen($this->sDescription) > 0;
}
}
}