Skip to content

Commit

Permalink
style: change code style according to StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Yogarine committed Oct 28, 2024
1 parent ce188e5 commit a4c9aad
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/EloquentSoftCascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

namespace Askedio\SoftCascade;

class EloquentSoftCascade extends SoftCascade {}
class EloquentSoftCascade extends SoftCascade
{
}
4 changes: 3 additions & 1 deletion src/Exceptions/SoftCascadeLogicException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

use RuntimeException;

class SoftCascadeLogicException extends RuntimeException {}
class SoftCascadeLogicException extends RuntimeException
{
}
5 changes: 3 additions & 2 deletions src/Exceptions/SoftCascadeRestrictedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SoftCascadeRestrictedException extends RuntimeException
*
* @param TModelString $model
* @param string $foreignKey
* @param int | int[] $foreignKeyIds
* @param int | int[] $foreignKeyIds
*
* @return $this
*/
Expand All @@ -46,7 +46,8 @@ public function setModel($model, $foreignKey, $foreignKeyIds)
$this->foreignKey = $foreignKey;
$this->foreignKeyIds = Arr::wrap($foreignKeyIds);

$this->message = "Integrity constraint violation [{$model}] where $foreignKey in (".implode(', ', $foreignKeyIds).')';
$this->message =
"Integrity constraint violation [{$model}] where $foreignKey in (".implode(', ', $foreignKeyIds).')';

return $this;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Listeners/CascadeRestoreListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ class CascadeRestoreListener
* @param string $event
* @param \Illuminate\Database\Eloquent\Model $model
*
* @return void
* @throws \Askedio\SoftCascade\Exceptions\SoftCascadeLogicException
*
* @return void
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter("event"))
* @noinspection PhpUnusedParameterInspection
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Providers/GenericServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class GenericServiceProvider extends ServiceProvider
*
* @return void
*/
public function register() {}
public function register()
{
}

/**
* Register routes, translations, views and publishers.
Expand Down
4 changes: 3 additions & 1 deletion src/Providers/LumenServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class LumenServiceProvider extends ServiceProvider
*
* @return void
*/
public function register() {}
public function register()
{
}

/**
* Register routes, translations, views and publishers.
Expand Down
4 changes: 3 additions & 1 deletion src/QueryBuilderSoftCascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

namespace Askedio\SoftCascade;

class QueryBuilderSoftCascade extends SoftCascade {}
class QueryBuilderSoftCascade extends SoftCascade
{
}
14 changes: 8 additions & 6 deletions src/SoftCascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ class SoftCascade implements SoftCascadeable
/**
* Cascade over Eloquent items.
*
* @param \Illuminate\Database\Eloquent\Model | Models $models
* @param 'update'|'delete'|'restore' $direction
* @param array $directionData
* @param \Illuminate\Database\Eloquent\Model | Models $models
* @param 'update'|'delete'|'restore' $direction
* @param array $directionData
*
* @return void
* @throws \Askedio\SoftCascade\Exceptions\SoftCascadeLogicException
*
* @return void
*
* @noinspection PhpDocMissingThrowsInspection,PhpUnhandledExceptionInspection
*/
public function cascade($models, $direction, array $directionData = [])
Expand All @@ -82,7 +83,7 @@ public function cascade($models, $direction, array $directionData = [])
/**
* Run the cascade.
*
* @param Models $models
* @param Models $models
*
* @return void
* @noinspection PhpDocMissingThrowsInspection,PhpUnhandledExceptionInspection
Expand Down Expand Up @@ -262,8 +263,9 @@ protected function execute($relation, $foreignKey, $foreignKeyIds, $affectedRows
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $relation
*
* @return void
* @throws \LogicException If $model doesn't support the given $relation.
*
* @return void
*/
protected function validateRelation($model, $relation)
{
Expand Down

0 comments on commit a4c9aad

Please sign in to comment.