From ee77facebe59a04caa965a8284202abe8a8a5319 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 27 Sep 2024 15:03:26 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Console/DropCollection.php | 6 +-- src/Console/GenerateModelDocumentation.php | 6 +-- src/Extensions/MongoCollection.php | 10 ++--- src/MongoAutoSyncServiceProvider.php | 2 +- src/Traits/Helper.php | 8 ++-- src/Traits/MainMongoTrait.php | 10 ++--- src/Traits/ModelAdditionalMethod.php | 2 +- src/Traits/RelationshipMongoTrait.php | 51 +++++++++++----------- src/syncUtils.php | 14 +++--- tests/SyncTestCase.php | 22 +++++----- tests/SyncUtilsTest.php | 1 - 11 files changed, 63 insertions(+), 69 deletions(-) diff --git a/src/Console/DropCollection.php b/src/Console/DropCollection.php index cedc767..e2860cb 100644 --- a/src/Console/DropCollection.php +++ b/src/Console/DropCollection.php @@ -67,7 +67,7 @@ public function handle() } /** - * @param $collection_name + * @param $collection_name * @return string * * @throws Exception @@ -80,8 +80,8 @@ public function getModelPathByName($collection_name) } /** - * @param $path - * @param $collection_name + * @param $path + * @param $collection_name * @return string * * @throws Exception diff --git a/src/Console/GenerateModelDocumentation.php b/src/Console/GenerateModelDocumentation.php index 934294d..2afb648 100644 --- a/src/Console/GenerateModelDocumentation.php +++ b/src/Console/GenerateModelDocumentation.php @@ -76,7 +76,7 @@ public function handle() } /** - * @param $collection_name + * @param $collection_name * @return string * * @throws Exception @@ -89,8 +89,8 @@ public function getModelPathByName($collection_name) } /** - * @param $path - * @param $collection_name + * @param $path + * @param $collection_name * @return string * * @throws Exception diff --git a/src/Extensions/MongoCollection.php b/src/Extensions/MongoCollection.php index df22978..8d58255 100644 --- a/src/Extensions/MongoCollection.php +++ b/src/Extensions/MongoCollection.php @@ -99,7 +99,7 @@ public function getPublic() //Check if the collection has an item with ref_id equal to id of the obj pass in to the parameter, useful to mark a category already selected in edit /** - * @param $obj + * @param $obj * @return bool */ public function hasItem($obj) @@ -130,7 +130,7 @@ public function hasItem($obj) //Move the item with ref_id equal to the parameter, useful for edit primary category /** - * @param $id + * @param $id * @return $this */ public function moveFirst($id) @@ -176,7 +176,7 @@ public function findByAID(string $aid) } /** - * @param $id + * @param $id * @return bool */ public function hasPermission($id) @@ -199,7 +199,7 @@ public function hasPermission($id) } /** - * @param $name + * @param $name * @return bool */ public function hasRole($name) @@ -222,7 +222,7 @@ public function hasRole($name) } /** - * @param $name + * @param $name * @return bool */ public function checkPermission($name) diff --git a/src/MongoAutoSyncServiceProvider.php b/src/MongoAutoSyncServiceProvider.php index 00fd29e..579a07b 100644 --- a/src/MongoAutoSyncServiceProvider.php +++ b/src/MongoAutoSyncServiceProvider.php @@ -44,7 +44,7 @@ public function register() } /** - * @param $path + * @param $path * @return string */ private function packagePath($path) diff --git a/src/Traits/Helper.php b/src/Traits/Helper.php index 611cfa0..6ef0179 100644 --- a/src/Traits/Helper.php +++ b/src/Traits/Helper.php @@ -8,7 +8,7 @@ trait Helper { /** - * @param $options + * @param $options * @return bool|mixed * * @throws Exception @@ -21,7 +21,7 @@ public function isArray($options) } /** - * @param $options + * @param $options * @return bool|mixed * * @throws Exception @@ -34,7 +34,7 @@ public function isCarbonDate($options) } /** - * @param $options + * @param $options * * @throws Exception */ @@ -46,7 +46,7 @@ private function validateOptions($options) } /** - * @param $value + * @param $value * @param string $expected * * @throws Exception diff --git a/src/Traits/MainMongoTrait.php b/src/Traits/MainMongoTrait.php index 7fc8a18..c8d1682 100644 --- a/src/Traits/MainMongoTrait.php +++ b/src/Traits/MainMongoTrait.php @@ -110,7 +110,7 @@ private function getOptionValue(array $options, string $key) } /** - * @param $obj + * @param $obj * @param string $EOkey * @param string $method * @param string $model @@ -126,7 +126,7 @@ public function checkPropertyExistence($obj, string $EOkey, $method = '', $model } /** - * @param $arr + * @param $arr * @param string $key * * @throws Exception @@ -174,9 +174,9 @@ public function getHasPartialRequest() public function setHasPartialRequest(): void { $this->has_partial_request = $this->getOptionValue( - $this->getOptions(), - 'request_type' - ) == 'partial'; + $this->getOptions(), + 'request_type' + ) == 'partial'; } /** diff --git a/src/Traits/ModelAdditionalMethod.php b/src/Traits/ModelAdditionalMethod.php index 980a5cc..2cd7a56 100644 --- a/src/Traits/ModelAdditionalMethod.php +++ b/src/Traits/ModelAdditionalMethod.php @@ -122,7 +122,7 @@ public function getFreshMiniModel(string $mini_model_path) /** * @param string $key - * @param $item + * @param $item * @param string $mini_model_path * @return array|mixed|UTCDateTime|null * diff --git a/src/Traits/RelationshipMongoTrait.php b/src/Traits/RelationshipMongoTrait.php index 5f5c6be..d25bfbd 100644 --- a/src/Traits/RelationshipMongoTrait.php +++ b/src/Traits/RelationshipMongoTrait.php @@ -73,7 +73,6 @@ public function processAllRelationships(Request $request, string $event, string if ($is_EO || $is_EM) {//EmbedsOne Create - EmbedsMany Create if ($event == 'update' && $is_embeds_has_to_be_updated) { - //Delete EmbedsMany or EmbedsOne on Target - TODO: check if it is necessary to run deleteTargetObj method if ($hasTarget) { $this->deleteTargetObj($method, $modelTarget, $methodOnTarget, $is_EO, $is_EM, $is_EO_target, $is_EM_target); @@ -124,7 +123,7 @@ public function processAllRelationships(Request $request, string $event, string } /** - * @param $mini_model + * @param $mini_model * @param string $method_on_target * @param bool $is_EO_target * @param bool $is_EM_target @@ -188,22 +187,22 @@ public function updateRelationWithSync($mini_model, string $method_on_target, $i /** * @param Request $request - * @param $obj - * @param $type - * @param $model - * @param $method - * @param $modelTarget - * @param $methodOnTarget - * @param $modelOnTarget - * @param $event - * @param $hasTarget + * @param $obj + * @param $type + * @param $model + * @param $method + * @param $modelTarget + * @param $methodOnTarget + * @param $modelOnTarget + * @param $event + * @param $hasTarget * @param bool $is_EO * @param bool $is_EM * @param bool $is_EO_target * @param bool $is_EM_target - * @param $i + * @param $i * @param bool $is_embeds_has_to_be_updated - * @param $options + * @param $options * * @throws Exception */ @@ -271,15 +270,15 @@ public function handleSubTarget(?string $target_id, string $modelTarget, string /** * @param Request $request - * @param $obj - * @param $type - * @param $model - * @param $method - * @param $event - * @param $is_EO - * @param $is_EM - * @param $i - * @param $options + * @param $obj + * @param $type + * @param $model + * @param $method + * @param $event + * @param $is_EO + * @param $is_EM + * @param $i + * @param $options * * @throws Exception */ @@ -329,10 +328,10 @@ private function processEmbedOnCurrentCollection(Request $request, $obj, $type, } /** - * @param $modelTarget - * @param $obj - * @param $methodOnTarget - * @param $modelOnTarget + * @param $modelTarget + * @param $obj + * @param $methodOnTarget + * @param $modelOnTarget * @param bool $is_EO_target * @param bool $is_EM_target * diff --git a/src/syncUtils.php b/src/syncUtils.php index da8f10f..b123014 100644 --- a/src/syncUtils.php +++ b/src/syncUtils.php @@ -5,7 +5,6 @@ use Jenssegers\Mongodb\Eloquent\Model; if (! function_exists('getTranslatedContent')) { - /** * @param array $mlCollection * @return string @@ -24,7 +23,6 @@ function getTranslatedContent($mlCollection) } if (! function_exists('cl')) { - /** * @return string current Lang */ @@ -166,9 +164,8 @@ function getAID(Model $model) } if (! function_exists('getArrayWithEmptyObj')) { - /** - * @param $model + * @param $model * @return array */ function getArrayWithEmptyObj($model, $is_EO, $is_EM) @@ -192,12 +189,11 @@ function getArrayWithEmptyObj($model, $is_EO, $is_EM) } if (! function_exists('getCounterForRelationships')) { - /** - * @param $method - * @param $is_EO - * @param $is_EM - * @param $i + * @param $method + * @param $is_EO + * @param $is_EM + * @param $i * @return string */ function getCounterForRelationships($method, $is_EO, $is_EM, $i) diff --git a/tests/SyncTestCase.php b/tests/SyncTestCase.php index 2ed3af9..ea2ca60 100644 --- a/tests/SyncTestCase.php +++ b/tests/SyncTestCase.php @@ -416,7 +416,7 @@ public function getMiniRoles($role_id = '') } /** - * @param $category_id + * @param $category_id * @return object * * @throws Exception @@ -441,7 +441,7 @@ public function prepareSingleMiniCategory($category_id) } /** - * @param $permission_id + * @param $permission_id * @return object * * @throws Exception @@ -465,7 +465,7 @@ public function prepareSingleMiniPermission($permission_id) } /** - * @param $role_id + * @param $role_id * @return object * * @throws Exception @@ -560,7 +560,7 @@ public function getMiniNavigation(string $navigation_id = '') } /** - * @param $navigation + * @param $navigation * @return bool */ public function isNavigationCreated($navigation) @@ -569,7 +569,7 @@ public function isNavigationCreated($navigation) } /** - * @param $item + * @param $item * @return bool */ public function isItemCreated($item) @@ -590,7 +590,7 @@ public function cleanUp(Navigation $navigation, SubItem $sub_item) } /** - * @param $item + * @param $item * @return bool */ public function isItemUpdatedCorrectly($item) @@ -599,7 +599,7 @@ public function isItemUpdatedCorrectly($item) } /** - * @param $navigation + * @param $navigation * @return bool */ public function isNavigationUpdatedCorrectly($navigation) @@ -608,7 +608,7 @@ public function isNavigationUpdatedCorrectly($navigation) } /** - * @param $navigation + * @param $navigation * @return bool */ public function isUpdated($navigation) @@ -617,8 +617,8 @@ public function isUpdated($navigation) } /** - * @param $navigation_id - * @param $item_id + * @param $navigation_id + * @param $item_id * @return bool */ public function isItemAddedInNavigationCollection($navigation_id, $item_id) @@ -635,7 +635,7 @@ public function isItemAddedInNavigationCollection($navigation_id, $item_id) } /** - * @param $navigation_code + * @param $navigation_code * @return false|string */ public function getNavigation($navigation_code) diff --git a/tests/SyncUtilsTest.php b/tests/SyncUtilsTest.php index 1fb7b96..6150568 100644 --- a/tests/SyncUtilsTest.php +++ b/tests/SyncUtilsTest.php @@ -41,7 +41,6 @@ public function test_cl() public function test_ml() { - // Input expected to be [ "en" => "1" ] from $out $destination = null;