From dcf25336ba2145f6d6497ca5ce47aa1ddec116bc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:17 +0100 Subject: [PATCH] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/core/class/timespent.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index a4327d55ae9..c3a830c5d48 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +112,7 @@ class TimeSpent extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),