Skip to content

Commit

Permalink
Merge pull request #11 from cesargb/analysis-Vrmjx6
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
cesargb authored Oct 14, 2021
2 parents 6c8418f + a16e20d commit 00ffb0b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/CascadeDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getCascadeDeleteMorph()
* Clean residual morph relation from a model. Return number
* of deleted rows.
*
* @param bool $dryRun
* @param bool $dryRun
* @return int
*/
public function deleteMorphResidual(bool $dryRun = false)
Expand Down
8 changes: 4 additions & 4 deletions src/Events/RelationMorphFromModelWasCleaned.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class RelationMorphFromModelWasCleaned
/**
* Event dispach when clean relations morph from model.
*
* @param Model $model
* @param Relation $relation
* @param int $numDeleted
* @param bool $dryRun
* @param Model $model
* @param Relation $relation
* @param int $numDeleted
* @param bool $dryRun
*/
public function __construct(Model $model, Relation $relation, int $numDeleted, bool $dryRun)
{
Expand Down
26 changes: 13 additions & 13 deletions src/Morph.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Morph
/**
* Delete polymorphic relationships of the single records from Model.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function delete($model)
Expand All @@ -33,7 +33,7 @@ public function delete($model)
/**
* Clean residual polymorphic relationships from all Models.
*
* @param bool $dryRun
* @param bool $dryRun
* @return int Num rows was deleted
*/
public function cleanResidualAllModels(bool $dryRun = false)
Expand All @@ -50,8 +50,8 @@ public function cleanResidualAllModels(bool $dryRun = false)
/**
* Clean residual polymorphic relationships from a Model.
*
* @param Model $model
* @param bool $dryRun
* @param Model $model
* @param bool $dryRun
* @return int Num rows was deleted
*/
public function cleanResidualByModel($model, bool $dryRun = false)
Expand Down Expand Up @@ -95,9 +95,9 @@ function ($modelName) {
/**
* Query to clean orphan morph table.
*
* @param Model $parentModel
* @param MorphOneOrMany|MorphToMany $relation
* @param bool $dryRun
* @param Model $parentModel
* @param MorphOneOrMany|MorphToMany $relation
* @param bool $dryRun
* @return int Num rows was deleted
*/
protected function queryCleanOrphan(Model $parentModel, Relation $relation, bool $dryRun = false)
Expand All @@ -124,7 +124,7 @@ protected function queryCleanOrphan(Model $parentModel, Relation $relation, bool
/**
* Get table and fields from morph relation.
*
* @param MorphOneOrMany|MorphToMany $relation
* @param MorphOneOrMany|MorphToMany $relation
* @return array [$table, $fieldType, $fieldId]
*/
protected function getStructureMorphRelation(Relation $relation): array
Expand Down Expand Up @@ -163,7 +163,7 @@ class_uses($class)
/**
* Fetch polymorphic relationships from a Model.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Illuminate\Database\Eloquent\Model $model
* @return array
*/
protected function getValidMorphRelationsFromModel($model)
Expand All @@ -184,8 +184,8 @@ function ($relation) {
/**
* Verify if method of a Model return a polymorphic relationship.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $methodName
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $methodName
* @return bool
*/
protected function methodReturnedMorphRelation($model, $methodName)
Expand All @@ -202,7 +202,7 @@ protected function methodReturnedMorphRelation($model, $methodName)
/**
* Verify if a object is a instance of a polymorphic relationship.
*
* @param mixed $relation
* @param mixed $relation
* @return bool
*/
protected function isMorphRelation($relation)
Expand All @@ -213,7 +213,7 @@ protected function isMorphRelation($relation)
/**
* Load models with Cascade Delete.
*
* @param array|string $path
* @param array|string $path
* @return void
*/
protected function load()
Expand Down
5 changes: 2 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ protected function setUp(): void
}

/**
* @param \Illuminate\Foundation\Application $app
*
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
Expand Down Expand Up @@ -56,7 +55,7 @@ protected function getEnvironmentSetUp($app)
/**
* Set up the database.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*/
protected function setUpDatabase($app)
{
Expand Down

0 comments on commit 00ffb0b

Please sign in to comment.