Skip to content

Commit

Permalink
Improve typing
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Nov 7, 2024
1 parent 4580a04 commit d75e9c5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ parameters:
- database
- src

level: 0
level: 5
4 changes: 2 additions & 2 deletions src/Drivers/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function getAll($features): array
return false;
}

$inserts[] = [
$inserts[] = [ // @phpstan-ignore offsetAssign.valueType
'name' => $feature,
'scope' => $scope,
'value' => $value,
Expand All @@ -176,7 +176,7 @@ public function getAll($features): array
});
})->all())->all();

if ($inserts->isNotEmpty()) {
if ($inserts->isNotEmpty()) { // @phpstan-ignore method.impossibleType
try {
$this->insertMany($inserts->all());
} catch (UniqueConstraintViolationException $e) {
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Decorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function define($feature, $resolver = null): void
$this->driver->define($feature, function ($scope) use ($feature, $resolver) {
if ($resolver instanceof LazilyResolvedFeature) {
$resolver = with($this->container[$resolver->feature], fn ($instance) => method_exists($instance, 'resolve')
? $instance->resolve(...)
? $instance->resolve(...) // @phpstan-ignore callable.nonNativeMethod
: $instance(...));
}

Expand Down
1 change: 0 additions & 1 deletion src/Events/FeatureUpdatedForAllScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class FeatureUpdatedForAllScopes
* Create a new event instance.
*
* @param string $feature
* @param mixed $scope
* @param mixed $value
*/
public function __construct($feature, $value)
Expand Down
1 change: 0 additions & 1 deletion src/PendingScopedFeatureInteraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function loadMissing($features)
/**
* Load all defined features into memory.
*
* @param string|array<int, string> $features
* @return array<string, array<int, mixed>>
*/
public function loadAll()
Expand Down

0 comments on commit d75e9c5

Please sign in to comment.