Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qual: Fix getKanban phpdoc #32917

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
return [
// # Issue statistics:
// PhanTypeMismatchArgument : 3730+ occurrences
// PhanTypeMismatchArgument : 3680+ occurrences
// PhanUndeclaredProperty : 540+ occurrences
// PhanTypeMismatchArgumentNullable : 450+ occurrences
// PhanUndeclaredGlobalVariable : 190+ occurrences
Expand Down Expand Up @@ -88,11 +88,9 @@ return [
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/adherents/class/subscription.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
'htdocs/adherents/stats/geo.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/adherents/subscription.php' => ['PhanTypeMismatchArgument'],
'htdocs/adherents/subscription/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/adherents/type.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/adherents/vcard.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down Expand Up @@ -288,7 +286,7 @@ return [
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument'],
'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/localtax/list.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'],
'htdocs/compta/paiement/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'],
Expand All @@ -303,8 +301,6 @@ return [
'htdocs/compta/prelevement/create.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/compta/prelevement/line.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/compta/prelevement/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/prelevement/orders_list.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
Expand Down Expand Up @@ -558,7 +554,7 @@ return [
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/don/list.php' => ['PhanTypeMismatchProperty'],
'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/stats/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'],
Expand Down Expand Up @@ -621,10 +617,8 @@ return [
'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
'htdocs/fourn/commande/dispatch.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/fourn/commande/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fourn/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/fourn/facture/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'],
'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
Expand Down Expand Up @@ -666,7 +660,6 @@ return [
'htdocs/loan/class/loan.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/loan/document.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/loan/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/loan/note.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/loan/schedule.php' => ['PhanTypeMismatchArgument'],
Expand Down Expand Up @@ -882,9 +875,8 @@ return [
'htdocs/salaries/class/salary.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/salaries/document.php' => ['PhanTypeMismatchArgument'],
'htdocs/salaries/info.php' => ['PhanTypeMismatchArgument'],
'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'],
'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/salaries/payments.php' => ['PhanTypeMismatchArgument'],
'htdocs/salaries/stats/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
Expand Down Expand Up @@ -960,7 +952,6 @@ return [
'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/document.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/user/group/card.php' => ['PhanTypeMismatchArgument'],
'htdocs/user/group/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/user/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/user/param_ihm.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/user/virtualcard.php' => ['PhanTypeMismatchArgument'],
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Copyright (C) 2020 Josep Lluís Amador <[email protected]>
* Copyright (C) 2021 Waël Almoman <[email protected]>
* Copyright (C) 2021 Philippe Grand <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -3344,7 +3344,7 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $f
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
16 changes: 8 additions & 8 deletions htdocs/adherents/class/adherent_type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (C) 2018-2019 Thibault Foucart <[email protected]>
* Copyright (C) 2021 Waël Almoman <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -299,12 +299,12 @@ public function setMultiLangs($user)
}

/**
* Delete a language for this member type
*
* @param string $langtodelete Language code to delete
* @param User $user Object user making delete
* @return int Return integer <0 if KO, >0 if OK
*/
* Delete a language for this member type
*
* @param string $langtodelete Language code to delete
* @param User $user Object user making delete
* @return int Return integer <0 if KO, >0 if OK
*/
public function delMultiLangs($langtodelete, $user)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public function getMailOnExclude()
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
10 changes: 5 additions & 5 deletions htdocs/adherents/class/subscription.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2006-2015 Laurent Destailleur <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -166,7 +166,7 @@ public function create($user, $notrigger = 0)
}

$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)";
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',";
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->dateh)."',";
$sql .= " '".$this->db->idate($this->datef)."',";
$sql .= " ".((float) $this->amount).",";
Expand Down Expand Up @@ -543,9 +543,9 @@ public function info($id)
/**
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{selected:?int,member:?Adherent,bank:?Account} $arraydata Array of data
* @return string HTML Code for Kanban thumb.
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param ?array{selected?:int|bool,adherent_type?:AdherentType,member?:Adherent,bank?:Account} $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
{
Expand Down
28 changes: 14 additions & 14 deletions htdocs/adherents/subscription/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <[email protected]>
* Copyright (C) 2004-2023 Laurent Destailleur <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -102,20 +102,20 @@
'c.note' => "Label",
);
$arrayfields = array(
'd.ref' => array('label' => "Ref", 'checked' => 1),
'd.fk_type' => array('label' => "Type", 'checked' => 1),
'd.lastname' => array('label' => "Lastname", 'checked' => 1),
'd.firstname' => array('label' => "Firstname", 'checked' => 1),
'd.login' => array('label' => "Login", 'checked' => 1),
'c.note' => array('label' => "Label", 'checked' => 1),
'd.bank' => array('label' => "BankAccount", 'checked' => 1, 'enabled' => (isModEnabled('bank'))),
'd.ref' => array('label' => "Ref", 'checked' => '1'),
'd.fk_type' => array('label' => "Type", 'checked' => '1'),
'd.lastname' => array('label' => "Lastname", 'checked' => '1'),
'd.firstname' => array('label' => "Firstname", 'checked' => '1'),
'd.login' => array('label' => "Login", 'checked' => '1'),
'c.note' => array('label' => "Label", 'checked' => '1'),
'd.bank' => array('label' => "BankAccount", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('bank'))),
/*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0),
'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/
'c.dateadh' => array('label' => "DateSubscription", 'checked' => 1, 'position' => 100),
'c.datef' => array('label' => "EndSubscription", 'checked' => 1, 'position' => 101),
'd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 102),
'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
'c.dateadh' => array('label' => "DateSubscription", 'checked' => '1', 'position' => 100),
'c.datef' => array('label' => "EndSubscription", 'checked' => '1', 'position' => 101),
'd.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 102),
'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500),
'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500),
// 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
);

Expand Down Expand Up @@ -223,7 +223,7 @@
}
}
if ($search_type > 0) {
$sql .= natural_search(array('c.fk_type'), $search_type);
$sql .= natural_search(array('c.fk_type'), (string) $search_type);
}
if ($search_lastname) {
$sql .= natural_search(array('d.lastname', 'd.societe'), $search_lastname);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/bookcal/class/availabilities.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2022 Alice Adminson <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -831,7 +831,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss
* Return a thumb for kanban views
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
6 changes: 3 additions & 3 deletions htdocs/bookcal/class/calendar.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2023-2024 Frédéric France <[email protected]>
* Copyright (C) 2023 Alice Adminson <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -816,8 +816,8 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss
/**
* Return a thumb for kanban views
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/class/propal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4014,7 +4014,7 @@ public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/bank/class/account.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright (C) 2016 Ferran Marcet <[email protected]>
* Copyright (C) 2019 JC Prieto <[email protected]><[email protected]>
* Copyright (C) 2022-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -2016,7 +2016,7 @@ public static function replaceThirdparty($dbs, $origin_id, $dest_id)
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/bank/class/paymentvarious.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017-2021 Alexandre Spangaro <[email protected]>
* Copyright (C) 2018-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -825,7 +825,7 @@ public function getVentilExportCompta()
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array{string,mixed} $arraydata Array of data
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
Expand Down
Loading
Loading