Skip to content

Commit

Permalink
Qual: Fix phan/phpstan notices
Browse files Browse the repository at this point in the history
# Qual: Fix phan/phpstan notices

Fix notices by adjusting phpdoc
  • Loading branch information
mdeweerd committed Oct 3, 2024
1 parent 88879e0 commit 4ea2339
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -12424,7 +12424,7 @@ 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}> $url Url for link or array of subbutton description
*
* Example when an array is used:
* $arrayforbutaction = array(
Expand All @@ -12434,7 +12434,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @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<int,array{confirm?:array{url?:string,title?:string,content?:string,action-btn-label?:string,cancel-button-label?:string,modal?:bool},attr:array<string,mixed>,isDropDown:bool,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled:bool,perm:int<0,1>,label:string,url:string,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
Expand Down Expand Up @@ -12468,7 +12468,6 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =

$out = '';

// @phan-suppress-next-line PhanTypeInvalidDimOffset
if (isset($params["areDropdownButtons"]) && $params["areDropdownButtons"] === false) {

Check warning on line 12471 in htdocs/core/lib/functions.lib.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

functions.lib.php: PhanTypeMismatchDimFetch: When fetching an array index from a value of type array|array&lt;int,array{confirm?:array{url?:string,title?:string,content?:string,action-btn-label?:string,cancel-button-label?:string,modal?:bool},attr:array&lt;string,mixed&gt;,isDropDown?:int,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled:bool,perm:int,label:string,url:string}&gt;, found an array index of type 'areDropdownButtons', but expected the index to be of type int
foreach ($url as $button) {
if (!empty($button['lang'])) {
Expand Down

0 comments on commit 4ea2339

Please sign in to comment.