mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Qual: Fix phan notices in API classes
This commit is contained in:
@@ -571,6 +571,8 @@ class Orders extends DolibarrApi
|
||||
* @param int $contactid Id of contact to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER)
|
||||
* @return array
|
||||
* @phan-return array{success:array{code:int,message:string}}
|
||||
* @phpstan-return array{success:array{code:int,message:string}}
|
||||
*
|
||||
* @url POST {id}/contact/{contactid}/{type}
|
||||
*
|
||||
@@ -620,6 +622,8 @@ class Orders extends DolibarrApi
|
||||
* @url DELETE {id}/contact/{contactid}/{type}
|
||||
*
|
||||
* @return array
|
||||
* @phan-return array{success:array{code:int,message:string}}
|
||||
* @phpstan-return array{success:array{code:int,message:string}}
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
@@ -721,6 +725,8 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @return array
|
||||
* @phan-return array{success:array{code:int,message:string}}
|
||||
* @phpstan-return array{success:array{code:int,message:string}}
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@@ -1145,12 +1151,15 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
* @param array $data Array with data to verify
|
||||
* @return array
|
||||
* @param ?array<string,string> $data Array with data to verify
|
||||
* @return array<string,string>
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _validate($data)
|
||||
{
|
||||
if ($data === null) {
|
||||
$data = array();
|
||||
}
|
||||
$commande = array();
|
||||
foreach (Orders::$FIELDS as $field) {
|
||||
if (!isset($data[$field])) {
|
||||
|
||||
Reference in New Issue
Block a user