From 3536bfc97e4ff90ed2961e3eaddcc5b255f86414 Mon Sep 17 00:00:00 2001 From: fgibaux Date: Mon, 10 Jul 2023 15:35:16 +0100 Subject: [PATCH 1/2] add missing types to Traits phphdoc --- src/Resources/Traits/FindsByName.php | 6 +++--- src/Resources/Traits/HandlesAssignments.php | 10 +++++----- src/Resources/Traits/ListsActivities.php | 2 +- src/Resources/Traits/ListsAttachedFiles.php | 2 +- src/Resources/Traits/ListsDeals.php | 2 +- src/Resources/Traits/ListsFollowers.php | 2 +- src/Resources/Traits/ListsPermittedUsers.php | 2 +- src/Resources/Traits/ListsProducts.php | 2 +- src/Resources/Traits/ListsUpdates.php | 2 +- src/Resources/Traits/Searches.php | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Resources/Traits/FindsByName.php b/src/Resources/Traits/FindsByName.php index 8ea597c..269f8ea 100644 --- a/src/Resources/Traits/FindsByName.php +++ b/src/Resources/Traits/FindsByName.php @@ -9,9 +9,9 @@ trait FindsByName /** * Find an element by name. * - * @param $term - * @param array $options - * @deprecated Use search method instead + * @param string $term + * @param array $options + * @deprecated Use search method instead * @return Response */ public function findByName($term, $options = []) diff --git a/src/Resources/Traits/HandlesAssignments.php b/src/Resources/Traits/HandlesAssignments.php index 870fb87..5c7aba1 100644 --- a/src/Resources/Traits/HandlesAssignments.php +++ b/src/Resources/Traits/HandlesAssignments.php @@ -9,7 +9,7 @@ trait HandlesAssignments /** * Get the resource assignments. * - * @param $id + * @param int $id * @param array $options * @return Response */ @@ -23,8 +23,8 @@ public function assignments($id, $options = []) /** * Add a new assignment to the resource. * - * @param $id - * @param $user_id + * @param int $id + * @param int $user_id * @return Response */ public function addAssignment($id, $user_id) @@ -35,8 +35,8 @@ public function addAssignment($id, $user_id) /** * Delete an assignemt from the resource. * - * @param $id - * @param $user_id + * @param int $id + * @param int $user_id * @return Response */ public function deleteAssignment($id, $user_id) diff --git a/src/Resources/Traits/ListsActivities.php b/src/Resources/Traits/ListsActivities.php index 07ada43..5baab12 100644 --- a/src/Resources/Traits/ListsActivities.php +++ b/src/Resources/Traits/ListsActivities.php @@ -9,7 +9,7 @@ trait ListsActivities /** * List the resource activities. * - * @param $id + * @param int $id * @param array $options * @return Response */ diff --git a/src/Resources/Traits/ListsAttachedFiles.php b/src/Resources/Traits/ListsAttachedFiles.php index 44da4eb..3937933 100644 --- a/src/Resources/Traits/ListsAttachedFiles.php +++ b/src/Resources/Traits/ListsAttachedFiles.php @@ -9,7 +9,7 @@ trait ListsAttachedFiles /** * Get the resource attached files. * - * @param $id The resource id + * @param int $id The resource id * @param array $options Extra parameters * @return Response */ diff --git a/src/Resources/Traits/ListsDeals.php b/src/Resources/Traits/ListsDeals.php index 85f478e..2428d55 100644 --- a/src/Resources/Traits/ListsDeals.php +++ b/src/Resources/Traits/ListsDeals.php @@ -9,7 +9,7 @@ trait ListsDeals /** * Get the resource deals. * - * @param $id The resource id + * @param int $id The resource id * @param array $options Extra parameters * @return Response */ diff --git a/src/Resources/Traits/ListsFollowers.php b/src/Resources/Traits/ListsFollowers.php index 6f72353..29bab7e 100644 --- a/src/Resources/Traits/ListsFollowers.php +++ b/src/Resources/Traits/ListsFollowers.php @@ -9,7 +9,7 @@ trait ListsFollowers /** * List the followers of a resource. * - * @param $id + * @param int $id * @return Response */ public function followers($id) diff --git a/src/Resources/Traits/ListsPermittedUsers.php b/src/Resources/Traits/ListsPermittedUsers.php index 347e444..f1e8131 100644 --- a/src/Resources/Traits/ListsPermittedUsers.php +++ b/src/Resources/Traits/ListsPermittedUsers.php @@ -9,7 +9,7 @@ trait ListsPermittedUsers /** * Get the resource permitted users. * - * @param $id The resource id + * @param int $id The resource id * @param null $access_level Access level value * @return Response */ diff --git a/src/Resources/Traits/ListsProducts.php b/src/Resources/Traits/ListsProducts.php index 2322d4b..3f5a462 100644 --- a/src/Resources/Traits/ListsProducts.php +++ b/src/Resources/Traits/ListsProducts.php @@ -9,7 +9,7 @@ trait ListsProducts /** * Get the products attached to a resource. * - * @param $id The resource id + * @param int $id The resource id * @param array $options Extra parameters * @return Response */ diff --git a/src/Resources/Traits/ListsUpdates.php b/src/Resources/Traits/ListsUpdates.php index 787d378..dd2138d 100644 --- a/src/Resources/Traits/ListsUpdates.php +++ b/src/Resources/Traits/ListsUpdates.php @@ -9,7 +9,7 @@ trait ListsUpdates /** * Get the resource updates. * - * @param $id + * @param int $id * @param array $options * @return Response */ diff --git a/src/Resources/Traits/Searches.php b/src/Resources/Traits/Searches.php index 562fcab..1dadac0 100644 --- a/src/Resources/Traits/Searches.php +++ b/src/Resources/Traits/Searches.php @@ -7,8 +7,8 @@ trait Searches { /** - * @param $term - * @param array $fields + * @param string $term + * @param array $fields * * @return Response */ From d1bc799fc0869abff7ad72344a953ba8402a8d69 Mon Sep 17 00:00:00 2001 From: fgibaux Date: Mon, 10 Jul 2023 15:42:22 +0100 Subject: [PATCH 2/2] add missing types to Basics phphdoc --- src/Resources/Basics/Entity.php | 14 +++++++------- src/Resources/Basics/Resource.php | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Resources/Basics/Entity.php b/src/Resources/Basics/Entity.php index 7c4ca12..b57a7aa 100644 --- a/src/Resources/Basics/Entity.php +++ b/src/Resources/Basics/Entity.php @@ -22,7 +22,7 @@ abstract class Entity extends Resource /** * List the resource associated emails. * - * @param $id + * @param int $id * @param array $options * @return Response */ @@ -36,8 +36,8 @@ public function emails($id, $options = []) /** * Add a follower to a resource. * - * @param $id - * @param $user_id + * @param int $id + * @param int $user_id * @return Response */ public function addFollower($id, $user_id) @@ -48,8 +48,8 @@ public function addFollower($id, $user_id) /** * Delete a follower from a resource. * - * @param $id - * @param $follower_id + * @param int $id + * @param int $follower_id * @return Response */ public function deleteFollower($id, $follower_id) @@ -60,8 +60,8 @@ public function deleteFollower($id, $follower_id) /** * Merge a resource with another. * - * @param $id - * @param $merge_with_id + * @param int $id + * @param int $merge_with_id * @return Response */ public function merge($id, $merge_with_id) diff --git a/src/Resources/Basics/Resource.php b/src/Resources/Basics/Resource.php index 8844e5c..6a9f8dd 100644 --- a/src/Resources/Basics/Resource.php +++ b/src/Resources/Basics/Resource.php @@ -89,7 +89,7 @@ public function add(array $values) /** * Update an entity by ID. * - * @param $id + * @param int $id * @param array $values * @return Response */ @@ -103,7 +103,7 @@ public function update($id, array $values) /** * Delete an entity by ID. * - * @param $id + * @param int $id * @return Response */ public function delete($id) @@ -137,7 +137,7 @@ public function getName() /** * Check if the method is enabled for use. * - * @param $method + * @param string $method * @return bool */ public function isEnabled($method) @@ -146,8 +146,8 @@ public function isEnabled($method) return false; } - // First we will make sure the method only belongs to this abtract class - // as this does not have to interfiere with methods described in child + // First we will make sure the method only belongs to this abstract class + // as this does not have to interfere with methods described in child // classes. We can now check if it is found in the enabled property. if (! in_array($method, get_class_methods(get_class()))) { return true; @@ -159,7 +159,7 @@ public function isEnabled($method) /** * Check if the method is disabled for use. * - * @param $method + * @param string $method * @return bool */ public function isDisabled($method) @@ -208,8 +208,8 @@ public function setDisabled($disabled) /** * Magic method call. * - * @param $method - * @param array $args + * @param string $method + * @param array $args * @return void * @throws PipedriveException */