mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8851 - Explicit nullable in functions parameters (#857)
This commit is contained in:
@@ -253,7 +253,7 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
* @throws FormBlockIOException
|
||||
* @throws RegisterException
|
||||
*/
|
||||
public function AddOutput(string $sName, string $sType, bool $bIsArray = false, AbstractConverter $oConverter = null): AbstractFormBlock
|
||||
public function AddOutput(string $sName, string $sType, bool $bIsArray = false, ?AbstractConverter $oConverter = null): AbstractFormBlock
|
||||
{
|
||||
$this->oIORegister->AddOutput($sName, $sType, $bIsArray, $oConverter);
|
||||
return $this;
|
||||
@@ -413,7 +413,7 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function IsInputsDataReady(string $sType = null): bool
|
||||
public function IsInputsDataReady(?string $sType = null): bool
|
||||
{
|
||||
return $this->oIORegister->IsInputsDataReady($sType);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
* @return bool
|
||||
* @throws FormBlockException
|
||||
*/
|
||||
public function IsVisible(string $sEventType = null): bool
|
||||
public function IsVisible(?string $sEventType = null): bool
|
||||
{
|
||||
$oInput = $this->GetInput(self::INPUT_VISIBLE);
|
||||
if (!$oInput->IsBound()) {
|
||||
@@ -68,7 +68,7 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
/**
|
||||
* @return true
|
||||
*/
|
||||
public function AllowAdd(string $sEventType = null): bool
|
||||
public function AllowAdd(?string $sEventType = null): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ class FormBlockService
|
||||
{
|
||||
private static FormBlockService $oInstance;
|
||||
|
||||
protected function __construct(ModelReflection $oModelReflection = null)
|
||||
protected function __construct(?ModelReflection $oModelReflection = null)
|
||||
{
|
||||
ServiceLocator::GetInstance()->RegisterService('ModelReflection', $oModelReflection ?? new ModelReflectionRuntime());
|
||||
}
|
||||
|
||||
final public static function GetInstance(ModelReflection $oModelReflection = null): FormBlockService
|
||||
final public static function GetInstance(?ModelReflection $oModelReflection = null): FormBlockService
|
||||
{
|
||||
if (!isset(static::$oInstance)) {
|
||||
static::$oInstance = new FormBlockService($oModelReflection);
|
||||
|
||||
Reference in New Issue
Block a user