diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 0d0a589..baab77b 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -5,3 +5,5 @@ on: [push] jobs: lint: uses: laravel/.github/.github/workflows/coding-standards.yml@main + with: + php: "8.3" diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2bc06ef..b98cb5f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,4 +4,4 @@ parameters: - database - src - level: 0 + level: 5 diff --git a/src/Drivers/DatabaseDriver.php b/src/Drivers/DatabaseDriver.php index 1291a5b..f5b6797 100644 --- a/src/Drivers/DatabaseDriver.php +++ b/src/Drivers/DatabaseDriver.php @@ -166,7 +166,7 @@ public function getAll($features): array return false; } - $inserts[] = [ + $inserts[] = [ // @phpstan-ignore offsetAssign.valueType 'name' => $feature, 'scope' => $scope, 'value' => $value, @@ -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) { diff --git a/src/Drivers/Decorator.php b/src/Drivers/Decorator.php index d1e31f1..ed0ff6c 100644 --- a/src/Drivers/Decorator.php +++ b/src/Drivers/Decorator.php @@ -142,7 +142,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(...)); } diff --git a/src/Events/FeatureUpdatedForAllScopes.php b/src/Events/FeatureUpdatedForAllScopes.php index 680854d..ae29fb0 100644 --- a/src/Events/FeatureUpdatedForAllScopes.php +++ b/src/Events/FeatureUpdatedForAllScopes.php @@ -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) diff --git a/src/PendingScopedFeatureInteraction.php b/src/PendingScopedFeatureInteraction.php index 352e2a5..654bdeb 100644 --- a/src/PendingScopedFeatureInteraction.php +++ b/src/PendingScopedFeatureInteraction.php @@ -78,7 +78,7 @@ public function loadMissing($features) public function loadAll() { return $this->load( - $this->driver->definedFeaturesForScope($this->scope()[0]) + $this->driver->definedFeaturesForScope($this->scope()[0])->all() ); } @@ -122,7 +122,7 @@ public function values($features) public function all() { return $this->values( - $this->driver->definedFeaturesForScope($this->scope()[0]) + $this->driver->definedFeaturesForScope($this->scope()[0])->all() ); } diff --git a/tests/Feature/DatabaseDriverTest.php b/tests/Feature/DatabaseDriverTest.php index 616847b..41f2cf9 100644 --- a/tests/Feature/DatabaseDriverTest.php +++ b/tests/Feature/DatabaseDriverTest.php @@ -3,8 +3,6 @@ namespace Tests\Feature; use Exception; -use Illuminate\Contracts\Auth\Access\Authorizable; -use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Events\QueryExecuted; use Illuminate\Database\UniqueConstraintViolationException; @@ -22,13 +20,11 @@ use Laravel\Pennant\Events\FeatureDeleted; use Laravel\Pennant\Events\FeatureResolved; use Laravel\Pennant\Events\FeaturesPurged; -use Laravel\Pennant\Events\FeatureUnavailableForScope; use Laravel\Pennant\Events\FeatureUpdated; use Laravel\Pennant\Events\FeatureUpdatedForAllScopes; use Laravel\Pennant\Events\UnexpectedNullScopeEncountered; use Laravel\Pennant\Events\UnknownFeatureResolved; use Laravel\Pennant\Feature; -use Laravel\Pennant\FeatureDoesNotMatchScope; use RuntimeException; use Tests\TestCase; use Workbench\App\Models\Team;