2
0
forked from Wavyzz/dolibarr

Qual: Fix phan/phpstan notices (#31259)

# Qual: Fix phan/phpstan notices

Fix notices by adjusting phpdoc
This commit is contained in:
MDW
2024-10-04 08:25:17 +02:00
committed by GitHub
parent 88879e0708
commit 6e01a60f59
3 changed files with 12 additions and 11 deletions

View File

@@ -12424,17 +12424,17 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @param string $text Optional : short label on button. Can be escaped HTML content or full simple text.
* @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ...
*
* @param string|array<int,array{lang:string,enabled:bool,perm:bool,label:string,url:string,urlroot:string}> $url Url for link or array of subbutton description
* @param string|array<int,array{lang:string,enabled:bool,perm:bool,label:string,url:string,urlroot?:string,isDropDown?:int<0,1>}> $url Url for link or array of subbutton description
*
* Example when an array is used:
* $arrayforbutaction = array(
* 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')),
* ); );
* Example when an array is used:
* $arrayforbutaction = array(
* 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')),
* ); );
* @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method.
* @param int|boolean $userRight User action right
* // phpcs:disable
* @param array<string,mixed> $params = [ // Various params for future : recommended rather than adding more function arguments
* @param array{confirm?:array{url?:string,title?:string,content?:string,action-btn-label?:string,cancel-btn-label?:string,modal?:bool},attr?:array<string,mixed>,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled?:bool,perm?:int<0,1>,label?:string,url?:string,isDropdown?:int<0,1>,isDropDown?:int<0,1>} $params = [ // Various params for future : recommended rather than adding more function arguments
* 'attr' => [ // to add or override button attributes
* 'xxxxx' => '', // your xxxxx attribute you want
* 'class' => 'reposition', // to add more css class to the button class attribute
@@ -12447,7 +12447,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* 'cancel-btn-label' => '', // Override label of cancel button, if empty default label use "CloseDialog" lang key
* 'content' => '', // Override text of content, if empty default content use "ConfirmBtnCommonContent" lang key
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
* 'isDropDrown' => false, // true|false to display dialog as a dropdown list (css dropdown-item with dark background)
* 'isDropDown' => false, // true|false to display dialog as a dropdown list (css dropdown-item with dark background)
* ],
* ]
* // phpcs:enable
@@ -12468,7 +12468,6 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
$out = '';
// @phan-suppress-next-line PhanTypeInvalidDimOffset
if (isset($params["areDropdownButtons"]) && $params["areDropdownButtons"] === false) {
foreach ($url as $button) {
if (!empty($button['lang'])) {