-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28872 from mdeweerd/fix/PhanTypeMismatchReturnPro…
…bablyReal Fix & enable PhanTypeMismatchReturnProbablyReal
- Loading branch information
Showing
6 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
/* Copyright (C) 2015 Jean-François Ferry <[email protected]> | ||
* Copyright (C) 2019 Frédéric France <[email protected]> | ||
* Copyright (C) 2024 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 | ||
|
@@ -167,7 +168,7 @@ public function getByEmail($email, $includecount = 0, $includeroles = 0) | |
* @param int $includecount Count and return also number of elements the contact is used as a link for | ||
* @param int $includeroles Includes roles of the contact | ||
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names | ||
* @return array Array of contact objects | ||
* @return Contact[] Array of contact objects | ||
* | ||
* @throws RestException | ||
*/ | ||
|
@@ -273,6 +274,8 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, | |
* | ||
* @param array $request_data Request datas | ||
* @return int ID of contact | ||
* | ||
* @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation | ||
*/ | ||
public function post($request_data = null) | ||
{ | ||
|
@@ -311,7 +314,7 @@ public function post($request_data = null) | |
* | ||
* @param int $id Id of contact to update | ||
* @param array $request_data Datas | ||
* @return Object Updated object | ||
* @return Object|false Updated object, false when issue toupdate | ||
*/ | ||
public function put($id, $request_data = null) | ||
{ | ||
|
@@ -389,6 +392,7 @@ public function delete($id) | |
* @return int ID of user | ||
* | ||
* @url POST {id}/createUser | ||
* @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation | ||
*/ | ||
public function createUser($id, $request_data = null) | ||
{ | ||
|
@@ -573,8 +577,8 @@ protected function _cleanObjectDatas($object) | |
/** | ||
* Validate fields before create or update object | ||
* | ||
* @param array|null $data Data to validate | ||
* @return array | ||
* @param string[]|null $data Data to validate | ||
* @return string[] | ||
* @throws RestException | ||
*/ | ||
private function _validate($data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
/* Copyright (C) 2010 Laurent Destailleur <[email protected]> | ||
* Copyright (C) 2023 Alexandre Janniaux <[email protected]> | ||
* Copyright (C) 2024 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 | ||
|
@@ -229,7 +230,7 @@ public function testRestUpdateContact($objid) | |
print_r($updateResponse); | ||
|
||
// Check if the updated fields match the changes you made | ||
$this->assertTrue($updateResponse['firstname'] === $updateBody['firstname'], 'Update might have failed'); | ||
$this->assertEquals($updateBody['firstname'], $updateResponse['firstname'], 'Update failed for request body: '.$updateRequestBody); | ||
|
||
// Deleting the Contact | ||
/* | ||
|