Skip to content

Commit

Permalink
fix php stan error
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Sep 25, 2023
1 parent d574e04 commit 72245d3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
51 changes: 51 additions & 0 deletions packages/admin/resources/lang/fr/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,60 @@

return [

'actions' => [
'create' => ':item ajouté avec succès',
'update' => ':item mis à jour avec succès',
'remove' => ':item supprimé(e) avec succès',
],

'attributes' => [
'remove' => 'L\'attribut a été supprimé avec succès',
'enable' => 'L\'attribut a été activé avec succès',
'disable' => 'L\'attribut a été désactivé avec succès',
],

'auth' => [
'password' => 'Ce mot de passe ne correspond pas à nos archives',
],

'analytics' => 'Vos configurations analytiques ont été correctement mises à jour',

'store_info' => 'Les informations sur le magasin ont été mises à jour avec succès',

'inventory' => [
'removed' => 'Inventaire supprimé avec succès',
],

'initialize' => 'Le magasin ayant été configuré avec succès, vous pouvez maintenant tout gérer',

'legal' => 'Votre politique juridique a été mise à jour avec succès',

'users_roles' => [
'role_deleted' => 'Rôle supprimé avec succès',
'role_added' => 'Un nouveau rôle a été ajouté avec succès',
'admin_deleted' => 'Admin supprimé avec succès',
'permission_add' => 'Une nouvelle autorisation a été créée et ajoutée à ce rôle',
'permission_revoke' => 'La permission :permission a été révoquée pour ce rôle',
'permission_allow' => 'La permission :permission a été donnée à ce rôle',
'password_changed' => 'Vous avez mis à jour votre mot de passe avec succès',
'current_password' => 'Ce n\'est pas votre mot de passe actuel',
'profile_update' => 'Votre profil a été mis à jour avec succès',
'two_factor_enabled' => 'Vous avez activé avec succès l\'authentification à deux facteurs',
'two_factor_disabled' => 'Vous avez désactivé avec succès l\'authentification à deux facteurs',
'two_factor_generate' => 'Vous avez régénéré avec succès vos codes de récupération de l\'authentification à deux facteurs',
],

'orders' => [
'archived' => 'Commande archivée avec succès',
],

'payment' => [
'add' => 'Votre méthode de paiement a été correctement ajoutée',
'update' => 'Votre mode de paiement a été correctement mis à jour',
],

'products' => [
'remove' => ':item a été correctement supprimé',
],

];
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function mount(int $productId, string $type, int $attributeId): void
->where('product_id', $this->productId)
->where('attribute_id', $this->attributeId)
->first();
$this->value = $this->model?->attribute_custom_value; // @phpstan-ignore-line
$this->value = $this->model?->attribute_custom_value;
}

public function onTrixValueUpdate(string $value): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function store(): void
'email_verified_at' => now()->toDateTimeString(),
]);

/** @var Role $role */
$role = Role::findById((int) $this->role_id);

$user->assignRole([$role->name]);
Expand All @@ -98,7 +99,7 @@ public function store(): void
$user->notify(new AdminSendCredentials($this->password));
}

session()->flash('success', __('shopper::notifications.actions.create', ['item' => $user->full_name])); // @phpstan-ignore-line
session()->flash('success', __('shopper::notifications.actions.create', ['item' => $user->full_name]));

$this->redirectRoute('shopper.settings.users');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function save(): void
'description' => $this->description,
]);

Role::findById($this->roleId)->givePermissionTo($permission->name);
Role::findById($this->roleId)->givePermissionTo($permission->name); // @phpstan-ignore-line

$this->dispatchBrowserEvent('permission-added');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Contracts\View\View;
use Livewire\WithPagination;
use LivewireUI\Modal\ModalComponent;
use Shopper\Core\Models\Product;
use Shopper\Core\Repositories\Ecommerce\ProductRepository;
use Shopper\Core\Repositories\InventoryHistoryRepository;
use Shopper\Core\Repositories\InventoryRepository;
Expand All @@ -21,6 +22,7 @@ class UpdateVariantStock extends ModalComponent

public function mount(int $id): void
{
/** @var Product $variant */
$this->product = $variant = (new ProductRepository())->getById($id);

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.

Check failure on line 26 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Variable $variant in PHPDoc tag @var does not exist.
$this->stock = $variant->stock;

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 27 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.
$this->realStock = $variant->stock;

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.

Check failure on line 28 in packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Access to an undefined property Illuminate\Database\Eloquent\Model::$stock.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Models/OrderRefund.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function setDefaultOrderRefundStatus(): void
$this->setRawAttributes(
array_merge(
$this->attributes,
['status' => OrderRefundStatus::PENDING->value()]
['status' => OrderRefundStatus::PENDING->value]
),
true
);
Expand Down

0 comments on commit 72245d3

Please sign in to comment.