diff --git a/src/Auditable.php b/src/Auditable.php index dfba925d..077ca768 100644 --- a/src/Auditable.php +++ b/src/Auditable.php @@ -711,9 +711,9 @@ public function auditDetach(string $relationName, $ids = null, $touch = true, $c } $old = $relationCall->get($columns); - + $pivotClass = $relationCall->getPivotClass(); - + if ($pivotClass !== Pivot::class && is_a($pivotClass, ContractsAuditable::class, true)) { $results = $pivotClass::withoutAuditing(function () use ($relationCall, $ids, $touch) { return $relationCall->detach($ids, $touch); @@ -721,7 +721,7 @@ public function auditDetach(string $relationName, $ids = null, $touch = true, $c } else { $results = $relationCall->detach($ids, $touch); } - + $new = $relationCall->get($columns); $this->dispatchRelationAuditEvent($relationName, 'detach', $old, $new); @@ -742,6 +742,7 @@ public function auditSync(string $relationName, $ids, $detaching = true, $column { $this->validateRelationshipMethodExistence($relationName, 'sync'); + /** @var BelongsToMany|\Illuminate\Database\Eloquent\Relations\MorphToMany $relationCall */ $relationCall = $this->{$relationName}(); if ($callback instanceof \Closure) { @@ -749,9 +750,9 @@ public function auditSync(string $relationName, $ids, $detaching = true, $column } $old = $relationCall->get($columns); - + $pivotClass = $relationCall->getPivotClass(); - + if ($pivotClass !== Pivot::class && is_a($pivotClass, ContractsAuditable::class, true)) { $changes = $pivotClass::withoutAuditing(function () use ($relationCall, $ids, $detaching) { return $relationCall->sync($ids, $detaching); diff --git a/src/Resolvers/UrlResolver.php b/src/Resolvers/UrlResolver.php index 388adbbb..31085e70 100644 --- a/src/Resolvers/UrlResolver.php +++ b/src/Resolvers/UrlResolver.php @@ -25,7 +25,7 @@ public static function resolve(Auditable $auditable): string public static function resolveCommandLine(): string { $command = Request::server('argv', null); - if (is_array($command)) { // @phpstan-ignore function.impossibleType + if (is_array($command)) { return implode(' ', $command); }