Skip to content

Commit

Permalink
Fix all PHPStan level MAX errors
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Aug 16, 2024
1 parent 6e153e6 commit 991ae41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ parameters:
# The level 8 is the highest level
level: max

checkMissingIterableValueType: false

checkGenericClassInNonGenericObjectType: false

reportUnmatchedIgnoredErrors: false

ignoreErrors:
- '#Internal.*#'
- '#Cannot access offset .* on array\{scheme.*#'
-
identifier: missingType.iterableValue
-
identifier: missingType.generics

strictRules:
disallowedLooseComparison: true
Expand Down
2 changes: 1 addition & 1 deletion src/Services/EdgeFlush.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function packageName(): string
return Helpers::configString('edge-flush.package.name') ?? 'edge-flush';
}

public function boot()
public function boot(): void
{
$this->tags->boot();

Expand Down
12 changes: 8 additions & 4 deletions src/Services/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ public function __construct(Model $model, string|null $event = null)
$this->makeEvent($model, $event);
}

public function absorb(Model $model)
public function absorb(Model $model): void
{
$model = EdgeFlushFacade::getInternalModel($model);

$this->modelClass = get_class($model);
if (is_string($class = get_class($model))) {
$this->modelClass = $class;
}

$this->id = $model->getKey();

$this->modelName = $this->makeModelName($model);
if (is_string($name = $this->makeModelName($model))) {
$this->modelName = $name;
}

$this->attributes = $this->absorbAttributes($model->getAttributes());

Expand Down Expand Up @@ -193,7 +197,7 @@ public function setRelation(array $relation): void

public function isRelationDirty(string|null $key): bool
{
if (empty($key)) {
if (blank($key)) {
return false;
}

Expand Down

0 comments on commit 991ae41

Please sign in to comment.