diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 116f394bea3..632e264ad9d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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 $url Url for link or array of subbutton description + * @param string|array}> $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&projectid='.$object->id.'&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&projectid='.$object->id.'&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 $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,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'])) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 30eec5bdbef..9cecd162492 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -247,7 +247,7 @@ class Ticket extends CommonObject public $ip; /** - * @var Ticket Save the ticket before an update operation (for triggers) + * @var static Save the ticket before an update operation (for triggers) */ public $oldcopy; @@ -1909,7 +1909,7 @@ class Ticket extends CommonObject //if (dol_mkdir($destdir) >= 0) { //require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; //dol_move($filespath, $destfile); // Disabled, a file for a ticket should be stored into ticket directory. It generates big trouble. - if (in_array($actioncomm->code, array('TICKET_MSG', 'TICKET_MSG_SENTBYMAIL'))) { + if (in_array($actioncomm->code, array('TICKET_MSG', 'TICKET_MSG_SENTBYMAIL'))) { $ecmfile = new EcmFiles($this->db); $destdir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $destdir); $destdir = preg_replace('/[\\/]$/', '', $destdir); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4ada2b118de..be4f8addc90 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -114,6 +114,8 @@ parameters: - '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#' - '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#' - '#colorHexToHsl expects float\|false, true#' + - '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#' + internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512