diff --git a/phpstan.neon b/phpstan.neon index 070af7710..521c1c00c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,4 +6,6 @@ parameters: - src/ - tests/ - routes/ + ignoreErrors: + - '#^Result of static method TorMorten\\Eventy\\Events::#' level: 1 diff --git a/src/Commands/IndexProductsCommand.php b/src/Commands/IndexProductsCommand.php index 02800816e..bc81ea2eb 100644 --- a/src/Commands/IndexProductsCommand.php +++ b/src/Commands/IndexProductsCommand.php @@ -31,7 +31,6 @@ public function handle(): void foreach ($stores as $store) { $this->line('Store: ' . $store['name']); - // @phpstan-ignore-next-line $this->prepareIndexerWithStore($store, 'products', Eventy::filter('index.product.mapping', [ 'properties' => [ 'price' => [ @@ -47,7 +46,7 @@ public function handle(): void 'type' => 'flattened', ], ], - ]), Eventy::filter('index.product.settings', []), ['name']); // @phpstan-ignore-line + ]), Eventy::filter('index.product.settings', []), ['name']); try { $maxPositions = CategoryProduct::query() @@ -96,7 +95,6 @@ public function handle(): void // Turn all positions positive ->mapWithKeys(fn ($position, $category_id) => [$category_id => $maxPositions[$category_id] - $position]); - // @phpstan-ignore-next-line return Eventy::filter('index.product.data', $data, $product); }); diff --git a/src/Http/Controllers/Fallback/LegacyFallbackController.php b/src/Http/Controllers/Fallback/LegacyFallbackController.php index 70c9fcbb0..c36a88ea3 100644 --- a/src/Http/Controllers/Fallback/LegacyFallbackController.php +++ b/src/Http/Controllers/Fallback/LegacyFallbackController.php @@ -8,7 +8,6 @@ class LegacyFallbackController { public function __invoke(): mixed { - // @phpstan-ignore-next-line foreach (Eventy::filter('routes', []) as $route) { ob_start(); require $route; diff --git a/src/Http/Controllers/ProductController.php b/src/Http/Controllers/ProductController.php index 186cba5cd..0c795cd6a 100644 --- a/src/Http/Controllers/ProductController.php +++ b/src/Http/Controllers/ProductController.php @@ -32,7 +32,7 @@ public function show(int $productId): View 'qty_increments', ]; - $attributes = Eventy::filter('productpage.frontend.attributes', $attributes); // @phpstan-ignore-line + $attributes = Eventy::filter('productpage.frontend.attributes', $attributes); foreach ($product->super_attributes ?: [] as $superAttribute) { $attributes[] = 'super_' . $superAttribute->code; diff --git a/src/Models/Product.php b/src/Models/Product.php index 68cb03c08..deb15f7cf 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -88,7 +88,7 @@ public function getCasts(): array ], $this->getSuperAttributeCasts(), $this->getMultiselectAttributeCasts(), - Eventy::filter('product.casts', []), // @phpstan-ignore-line + Eventy::filter('product.casts', []), ); } diff --git a/src/Models/QuoteItemOption.php b/src/Models/QuoteItemOption.php index ee94ba97b..7e3e7a48a 100644 --- a/src/Models/QuoteItemOption.php +++ b/src/Models/QuoteItemOption.php @@ -30,7 +30,6 @@ protected function value(): Attribute { return Attribute::make( get: function (string $value) { - // @phpstan-ignore-next-line $value = Eventy::filter('quote_item_option.value', $value, $this); if (isset($this->option) && in_array($this->option->type, ['drop_down', 'radio'])) { diff --git a/src/Models/Scopes/Product/WithProductChildrenScope.php b/src/Models/Scopes/Product/WithProductChildrenScope.php index c88daaa6f..8f13e50c5 100644 --- a/src/Models/Scopes/Product/WithProductChildrenScope.php +++ b/src/Models/Scopes/Product/WithProductChildrenScope.php @@ -30,7 +30,6 @@ public function apply(Builder $builder, Model $model) $store = config('rapidez.store', 0); $stockQty = config('rapidez.system.expose_stock') ? '"qty", children_stock.qty,' : ''; - // @phpstan-ignore-next-line $selects = Eventy::filter('product.children.select', <<last() ?? 'undefined'); /** @var array $scopes */ - // @phpstan-ignore-next-line $scopes = Eventy::filter($eventyName . '.scopes', []); foreach ($scopes as $scope) { @@ -30,7 +29,6 @@ public static function bootHasEventyGlobalScopeFilter(): void public function scopeWithEventyGlobalScopes(Builder $query, string $scope): Builder { /** @var array $scopes */ - // @phpstan-ignore-next-line $scopes = Eventy::filter($scope, []); foreach ($scopes as $scope) { diff --git a/src/Models/Traits/Product/SelectAttributeScopes.php b/src/Models/Traits/Product/SelectAttributeScopes.php index 28e576943..dc7a85bfd 100644 --- a/src/Models/Traits/Product/SelectAttributeScopes.php +++ b/src/Models/Traits/Product/SelectAttributeScopes.php @@ -75,7 +75,6 @@ public function scopeSelectOnlyIndexable(Builder $query): Builder return true; } - // @phpstan-ignore-next-line $alwaysInFlat = array_merge(['sku'], Eventy::filter('index.product.attributes', [])); if (in_array($attribute['code'], $alwaysInFlat)) { return true;