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:
@@ -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 $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 $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:
|
* Example when an array is used:
|
||||||
* $arrayforbutaction = array(
|
* $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),
|
* 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')),
|
* 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 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
|
* @param int|boolean $userRight User action right
|
||||||
* // phpcs:disable
|
* // 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
|
* 'attr' => [ // to add or override button attributes
|
||||||
* 'xxxxx' => '', // your xxxxx attribute you want
|
* 'xxxxx' => '', // your xxxxx attribute you want
|
||||||
* 'class' => 'reposition', // to add more css class to the button class attribute
|
* '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
|
* '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
|
* '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)
|
* '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
|
* // phpcs:enable
|
||||||
@@ -12468,7 +12468,6 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
|
|||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
|
||||||
if (isset($params["areDropdownButtons"]) && $params["areDropdownButtons"] === false) {
|
if (isset($params["areDropdownButtons"]) && $params["areDropdownButtons"] === false) {
|
||||||
foreach ($url as $button) {
|
foreach ($url as $button) {
|
||||||
if (!empty($button['lang'])) {
|
if (!empty($button['lang'])) {
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ class Ticket extends CommonObject
|
|||||||
public $ip;
|
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;
|
public $oldcopy;
|
||||||
|
|
||||||
@@ -1909,7 +1909,7 @@ class Ticket extends CommonObject
|
|||||||
//if (dol_mkdir($destdir) >= 0) {
|
//if (dol_mkdir($destdir) >= 0) {
|
||||||
//require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
//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.
|
//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);
|
$ecmfile = new EcmFiles($this->db);
|
||||||
$destdir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $destdir);
|
$destdir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $destdir);
|
||||||
$destdir = preg_replace('/[\\/]$/', '', $destdir);
|
$destdir = preg_replace('/[\\/]$/', '', $destdir);
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ parameters:
|
|||||||
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
|
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
|
||||||
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
|
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
|
||||||
- '#colorHexToHsl expects float\|false, true#'
|
- '#colorHexToHsl expects float\|false, true#'
|
||||||
|
- '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#'
|
||||||
|
|
||||||
internalErrorsCountLimit: 50
|
internalErrorsCountLimit: 50
|
||||||
cache:
|
cache:
|
||||||
nodesByFileCountMax: 512
|
nodesByFileCountMax: 512
|
||||||
|
|||||||
Reference in New Issue
Block a user