Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Sep 27, 2024
1 parent c26d248 commit ee77fac
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 69 deletions.
6 changes: 3 additions & 3 deletions src/Console/DropCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function handle()
}

/**
* @param $collection_name
* @param $collection_name
* @return string
*
* @throws Exception
Expand All @@ -80,8 +80,8 @@ public function getModelPathByName($collection_name)
}

/**
* @param $path
* @param $collection_name
* @param $path
* @param $collection_name
* @return string
*
* @throws Exception
Expand Down
6 changes: 3 additions & 3 deletions src/Console/GenerateModelDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function handle()
}

/**
* @param $collection_name
* @param $collection_name
* @return string
*
* @throws Exception
Expand All @@ -89,8 +89,8 @@ public function getModelPathByName($collection_name)
}

/**
* @param $path
* @param $collection_name
* @param $path
* @param $collection_name
* @return string
*
* @throws Exception
Expand Down
10 changes: 5 additions & 5 deletions src/Extensions/MongoCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -176,7 +176,7 @@ public function findByAID(string $aid)
}

/**
* @param $id
* @param $id
* @return bool
*/
public function hasPermission($id)
Expand All @@ -199,7 +199,7 @@ public function hasPermission($id)
}

/**
* @param $name
* @param $name
* @return bool
*/
public function hasRole($name)
Expand All @@ -222,7 +222,7 @@ public function hasRole($name)
}

/**
* @param $name
* @param $name
* @return bool
*/
public function checkPermission($name)
Expand Down
2 changes: 1 addition & 1 deletion src/MongoAutoSyncServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function register()
}

/**
* @param $path
* @param $path
* @return string
*/
private function packagePath($path)
Expand Down
8 changes: 4 additions & 4 deletions src/Traits/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trait Helper
{
/**
* @param $options
* @param $options
* @return bool|mixed
*
* @throws Exception
Expand All @@ -21,7 +21,7 @@ public function isArray($options)
}

/**
* @param $options
* @param $options
* @return bool|mixed
*
* @throws Exception
Expand All @@ -34,7 +34,7 @@ public function isCarbonDate($options)
}

/**
* @param $options
* @param $options
*
* @throws Exception
*/
Expand All @@ -46,7 +46,7 @@ private function validateOptions($options)
}

/**
* @param $value
* @param $value
* @param string $expected
*
* @throws Exception
Expand Down
10 changes: 5 additions & 5 deletions src/Traits/MainMongoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private function getOptionValue(array $options, string $key)
}

/**
* @param $obj
* @param $obj
* @param string $EOkey
* @param string $method
* @param string $model
Expand All @@ -126,7 +126,7 @@ public function checkPropertyExistence($obj, string $EOkey, $method = '', $model
}

/**
* @param $arr
* @param $arr
* @param string $key
*
* @throws Exception
Expand Down Expand Up @@ -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';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ModelAdditionalMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
51 changes: 25 additions & 26 deletions src/Traits/RelationshipMongoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*
Expand Down
14 changes: 5 additions & 9 deletions src/syncUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Jenssegers\Mongodb\Eloquent\Model;

if (! function_exists('getTranslatedContent')) {

/**
* @param array $mlCollection
* @return string
Expand All @@ -24,7 +23,6 @@ function getTranslatedContent($mlCollection)
}

if (! function_exists('cl')) {

/**
* @return string current Lang
*/
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions tests/SyncTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public function getMiniRoles($role_id = '')
}

/**
* @param $category_id
* @param $category_id
* @return object
*
* @throws Exception
Expand All @@ -441,7 +441,7 @@ public function prepareSingleMiniCategory($category_id)
}

/**
* @param $permission_id
* @param $permission_id
* @return object
*
* @throws Exception
Expand All @@ -465,7 +465,7 @@ public function prepareSingleMiniPermission($permission_id)
}

/**
* @param $role_id
* @param $role_id
* @return object
*
* @throws Exception
Expand Down Expand Up @@ -560,7 +560,7 @@ public function getMiniNavigation(string $navigation_id = '')
}

/**
* @param $navigation
* @param $navigation
* @return bool
*/
public function isNavigationCreated($navigation)
Expand All @@ -569,7 +569,7 @@ public function isNavigationCreated($navigation)
}

/**
* @param $item
* @param $item
* @return bool
*/
public function isItemCreated($item)
Expand All @@ -590,7 +590,7 @@ public function cleanUp(Navigation $navigation, SubItem $sub_item)
}

/**
* @param $item
* @param $item
* @return bool
*/
public function isItemUpdatedCorrectly($item)
Expand All @@ -599,7 +599,7 @@ public function isItemUpdatedCorrectly($item)
}

/**
* @param $navigation
* @param $navigation
* @return bool
*/
public function isNavigationUpdatedCorrectly($navigation)
Expand All @@ -608,7 +608,7 @@ public function isNavigationUpdatedCorrectly($navigation)
}

/**
* @param $navigation
* @param $navigation
* @return bool
*/
public function isUpdated($navigation)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading

0 comments on commit ee77fac

Please sign in to comment.