Skip to content

Commit

Permalink
Add PHPDoc typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Aug 23, 2024
1 parent e402b31 commit ee5424b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
// $toselect may be defined
// $diroutputmassaction may be defined

'
@phan-var-force ?string $permissiontoread
@phan-var-force ?string $permissiontodelete
@phan-var-force ?string $permissiontoclose
@phan-var-force ?string $permissiontoread
@phan-var-force ?int[] $toselect
@phan-var-force ?string $diroutputmassaction
';


// Protection
if (empty($objectclass) || empty($uploaddir)) {
Expand All @@ -51,6 +60,7 @@
'
@phan-var-force "Societe"|"Contact"|"ExpenseReport"|"Partnership"|"Holiday"|"ConferenceOrBoothAttendee"|"Facture"|"CommandeFournisseur" $objectclass
@phan-var-force string $massaction
@phan-var-force string $uploaddir
';


Expand Down Expand Up @@ -1282,6 +1292,7 @@

if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) {
'@phan-var-force Product|ProductCustomerPrice $obj';
'@phan-var-force Product|ProductCustomerPrice $object';
$nbok = 0;
$db->begin();
if (GETPOSTISSET('pricerate')) {
Expand Down Expand Up @@ -1377,7 +1388,7 @@
$res = $object->add_contact($usertoaffect, $projectrole, 'internal');
if ($res >= 0) {
$taskstatic = new Task($db);
$task_array = $taskstatic->getTasksArray(0, 0, $object->id, 0, 0);
$task_array = $taskstatic->getTasksArray(null, null, $object->id, 0, 0);

foreach ($task_array as $task) {
$tasksToAffect = new Task($db);
Expand Down Expand Up @@ -1625,7 +1636,7 @@
continue;
}
if ($user->id == $objecttmp->fk_validator) {
$objecttmp->oldcopy = dol_clone($objecttmp, 2);
$objecttmp->oldcopy = dol_clone($objecttmp, 2); // @phan-suppress-current-line PhanTypeMismatchProperty

$objecttmp->date_valid = dol_now();
$objecttmp->fk_user_valid = $user->id;
Expand Down Expand Up @@ -1733,6 +1744,7 @@
}

if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday' && $confirm == 'yes')) && $permissiontoapprove) {
'@phan-var-force Holiday $holiday'; // Supposing that $holiday is set, it is needed.
$db->begin();
$objecttmp = new $objectclass($db);
$nbok = 0;
Expand Down

0 comments on commit ee5424b

Please sign in to comment.