2
0
forked from Wavyzz/dolibarr

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
This commit is contained in:
MDW
2024-03-11 17:40:33 +01:00
parent 13fcaf19f2
commit c58a2db86b

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@@ -75,7 +76,7 @@ class ProductAttributeValue extends CommonObjectLine
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
*/
/**
* @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<string,array{type:string,label:string,enabled:int<0,2>,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<int,string>,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"),