Skip to content

Commit

Permalink
Ignore eventy error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG committed Oct 18, 2024
1 parent 8c6f966 commit 4ec6aee
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 12 deletions.
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ parameters:
- src/
- tests/
- routes/
ignoreErrors:
- '#^Result of static method TorMorten\\Eventy\\Events::#'
level: 1
4 changes: 1 addition & 3 deletions src/Commands/IndexProductsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand All @@ -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()
Expand Down Expand Up @@ -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);
});

Expand Down
1 change: 0 additions & 1 deletion src/Http/Controllers/Fallback/LegacyFallbackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class LegacyFallbackController
{
public function __invoke(): mixed
{
// @phpstan-ignore-next-line
foreach (Eventy::filter('routes', []) as $route) {
ob_start();
require $route;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getCasts(): array
],
$this->getSuperAttributeCasts(),
$this->getMultiselectAttributeCasts(),
Eventy::filter('product.casts', []), // @phpstan-ignore-line
Eventy::filter('product.casts', []),
);
}

Expand Down
1 change: 0 additions & 1 deletion src/Models/QuoteItemOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
1 change: 0 additions & 1 deletion src/Models/Scopes/Product/WithProductChildrenScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', <<<QUERY
"sku", children.sku,
"price", children.price,
Expand Down
1 change: 0 additions & 1 deletion src/Models/Scopes/Product/WithProductGroupedScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public function apply(Builder $builder, Model $model)
{
$stockQty = config('rapidez.system.expose_stock') ? '"qty", grouped_stock.qty,' : '';

// @phpstan-ignore-next-line
$selects = Eventy::filter('product.grouped.select', <<<QUERY
"entity_id", grouped.entity_id,
"sku", grouped.sku,
Expand Down
2 changes: 0 additions & 2 deletions src/Models/Traits/HasEventyGlobalScopeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public static function bootHasEventyGlobalScopeFilter(): void
$eventyName = strtolower(collect(explode('\\', get_called_class()))->last() ?? 'undefined');

/** @var array<string> $scopes */
// @phpstan-ignore-next-line
$scopes = Eventy::filter($eventyName . '.scopes', []);

foreach ($scopes as $scope) {
Expand All @@ -30,7 +29,6 @@ public static function bootHasEventyGlobalScopeFilter(): void
public function scopeWithEventyGlobalScopes(Builder $query, string $scope): Builder
{
/** @var array<string> $scopes */
// @phpstan-ignore-next-line
$scopes = Eventy::filter($scope, []);

foreach ($scopes as $scope) {
Expand Down
1 change: 0 additions & 1 deletion src/Models/Traits/Product/SelectAttributeScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ec6aee

Please sign in to comment.