diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index a84871b25fc..8ad1c46c169 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -746,7 +746,7 @@ if ($action == 'create') { } // else { $object->lines[$i]->fk_product_type; } // TODO: $objp is not set here, so why test? - if (isset($objp) && is_object($objp)) { + if (isset($objp) && is_object($objp)) { // $objp always null @phpstan-ignore-line // Try to enhance type detection using date_start and date_end for free lines when type // was not saved. if (!empty($objp->date_start)) { diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 57699f6f593..7a86225622e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2025 MDW + * Copyright (C) 2025 MDW * * 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 @@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; class Interventions extends DolibarrApi { /** - * @var array Mandatory fields, checked when create and update object + * @var string[] Mandatory fields, checked when create and update object */ public static $FIELDS = array( - 'socid', - 'fk_project', - 'description', + 'socid', + 'fk_project', + 'description', ); /** - * @var array Mandatory fields, checked when create and update object + * @var string[] Mandatory fields, checked when create and update object */ public static $FIELDSLINE = array( - 'description', - 'date', - 'duree', + 'description', + 'date', + 'duree', ); /** @@ -108,6 +108,8 @@ class Interventions extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names * @return array Array of order objects + * @phan-return array + * @phpstan-return array * * @throws RestException */ @@ -187,6 +189,8 @@ class Interventions extends DolibarrApi * Create intervention object * * @param array $request_data Request data + * @phan-param ?array $request_data + * @phpstan-param ?array $request_data * @return int ID of intervention */ public function post($request_data = null) @@ -252,6 +256,8 @@ class Interventions extends DolibarrApi * * @param int $id Id of intervention to update * @param array $request_data Request data + * @phan-param ?array $request_data + * @phpstan-param ?array $request_data * * @url POST {id}/lines * @@ -303,6 +309,8 @@ class Interventions extends DolibarrApi * * @param int $id Order ID * @return array + * @phan-return array + * @phpstan-return array */ public function delete($id) { @@ -412,8 +420,8 @@ class Interventions extends DolibarrApi /** * Validate fields before create or update object * - * @param array $data Data to validate - * @return array + * @param ?array $data Data to validate + * @return array * * @throws RestException */ @@ -451,8 +459,8 @@ class Interventions extends DolibarrApi /** * Validate fields before create or update object * - * @param array $data Data to validate - * @return array + * @param array $data Data to validate + * @return array Return array with validated mandatory fields and their value * * @throws RestException */