Skip to content

Commit

Permalink
Apply Developer tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Jul 6, 2023
1 parent f07a6f5 commit 7d62aa9
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 97 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"baseline": "./vendor/bin/phpstan analyse --generate-baseline",
"pint": "./vendor/bin/pint",
"pest": "./vendor/bin/pest",
"phpstan": "./vendor/bin/phpstan analyse"
"stan": "./vendor/bin/phpstan analyse"
},
"config": {
"sort-packages": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Model;
use Livewire\WithFileUploads;
use Shopper\Core\Events\Products\Updated;
use Shopper\Core\Exceptions\GeneralException;
Expand All @@ -27,7 +26,7 @@ class Edit extends AbstractBaseComponent
use WithUploadProcess;
use WithSeoAttributes;

public Model $product;
public $product;

public int $productId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Livewire\Component;
use Livewire\WithFileUploads;
use Livewire\WithPagination;
Expand All @@ -25,7 +24,7 @@ class Variants extends Component

public string $search = '';

public Model $product;
public $product;

public $quantity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Validation\Rule;
use Livewire\Component;
use Livewire\WithFileUploads;
Expand All @@ -21,9 +20,9 @@ class Variant extends Component
use WithUploadProcess;
use WithAttributes;

public Model $product;
public $product;

public Model $variant;
public $variant;

public Collection $inventories;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shopper\Http\Livewire\Pages\Auth;

use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Auth\Passwords\PasswordBroker;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Password;
use Livewire\Component;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Repositories/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function get(array $columns = ['*']): Collection
return $models;
}

public function getById($id, array $columns = ['*']): Collection|Model
public function getById($id, array $columns = ['*']): Model
{
$this->unsetClauses();

Expand Down
2 changes: 1 addition & 1 deletion packages/sidebar/src/Contracts/Builder/Badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shopper\Sidebar\Contracts\Builder;

interface Badge
interface Badge extends Authorizable
{
public function getValue(): mixed;

Expand Down
107 changes: 21 additions & 86 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -475,36 +475,11 @@ parameters:
count: 2
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:addMedia\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:categories\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:collections\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getMedia\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:scopes\\(\\)\\.$#"
count: 2
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Parameter \\#1 \\$product of class Shopper\\\\Core\\\\Events\\\\Products\\\\Updated constructor expects Shopper\\\\Core\\\\Models\\\\Product, Illuminate\\\\Database\\\\Eloquent\\\\Model given\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Edit.php

-
message: "#^Ternary operator condition is always false\\.$#"
count: 2
Expand Down Expand Up @@ -555,46 +530,11 @@ parameters:
count: 2
path: packages/admin/src/Http/Livewire/Components/Products/Form/Seo.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$id\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Variants.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:where\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Variants.php

-
message: "#^Parameter \\#1 \\$product of class Shopper\\\\Core\\\\Events\\\\Products\\\\Deleted constructor expects Shopper\\\\Core\\\\Models\\\\Product, Illuminate\\\\Database\\\\Eloquent\\\\Collection\\|Illuminate\\\\Database\\\\Eloquent\\\\Model given\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Form/Variants.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$id\\.$#"
count: 3
path: packages/admin/src/Http/Livewire/Components/Products/Variant.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:addMedia\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Variant.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getFirstMedia\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Variant.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getMedia\\(\\)\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Variant.php

-
message: "#^Parameter \\#1 \\$product of class Shopper\\\\Core\\\\Events\\\\Products\\\\Updated constructor expects Shopper\\\\Core\\\\Models\\\\Product, Illuminate\\\\Database\\\\Eloquent\\\\Model given\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Components/Products/Variant.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$id\\.$#"
count: 3
Expand Down Expand Up @@ -920,11 +860,6 @@ parameters:
count: 1
path: packages/admin/src/Http/Livewire/Modals/CreateValue.php

-
message: "#^Parameter \\#1 \\$product of class Shopper\\\\Core\\\\Events\\\\Products\\\\Deleted constructor expects Shopper\\\\Core\\\\Models\\\\Product, Illuminate\\\\Database\\\\Eloquent\\\\Collection\\|Illuminate\\\\Database\\\\Eloquent\\\\Model given\\.$#"
count: 1
path: packages/admin/src/Http/Livewire/Modals/DeleteProduct.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:whereHas\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -970,19 +905,14 @@ parameters:
count: 1
path: packages/admin/src/Http/Livewire/Modals/UpdateValue.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Collection\\|Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$stock\\.$#"
count: 2
path: packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$id\\.$#"
count: 3
path: packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

-
message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$stock\\.$#"
count: 1
count: 3
path: packages/admin/src/Http/Livewire/Modals/UpdateVariantStock.php

-
Expand Down Expand Up @@ -1175,21 +1105,6 @@ parameters:
count: 1
path: packages/core/database/seeders/AuthTableSeeder.php

-
message: "#^Constructor of class Shopper\\\\Core\\\\Events\\\\Products\\\\Created has an unused parameter \\$product\\.$#"
count: 1
path: packages/core/src/Events/Products/Created.php

-
message: "#^Constructor of class Shopper\\\\Core\\\\Events\\\\Products\\\\Deleted has an unused parameter \\$product\\.$#"
count: 1
path: packages/core/src/Events/Products/Deleted.php

-
message: "#^Constructor of class Shopper\\\\Core\\\\Events\\\\Products\\\\Updated has an unused parameter \\$product\\.$#"
count: 1
path: packages/core/src/Events/Products/Updated.php

-
message: "#^Access to an undefined property Shopper\\\\Core\\\\Models\\\\Address\\:\\:\\$first_name\\.$#"
count: 2
Expand Down Expand Up @@ -1774,3 +1689,23 @@ parameters:
message: "#^Cannot access property \\$code on array\\<Illuminate\\\\Database\\\\Eloquent\\\\Builder\\>\\|Illuminate\\\\Database\\\\Eloquent\\\\Builder\\|Illuminate\\\\Database\\\\Eloquent\\\\Collection\\|Illuminate\\\\Database\\\\Eloquent\\\\Model\\.$#"
count: 1
path: packages/core/src/helpers.php

-
message: "#^Method Shopper\\\\Sidebar\\\\Presentation\\\\View\\\\AppendRenderer\\:\\:render\\(\\) should return Illuminate\\\\Contracts\\\\View\\\\View\\|null but returns string\\.$#"
count: 1
path: packages/sidebar/src/Presentation/View/AppendRenderer.php

-
message: "#^Method Shopper\\\\Sidebar\\\\Presentation\\\\View\\\\BadgeRenderer\\:\\:render\\(\\) should return Illuminate\\\\Contracts\\\\View\\\\View\\|null but returns string\\.$#"
count: 1
path: packages/sidebar/src/Presentation/View/BadgeRenderer.php

-
message: "#^Method Shopper\\\\Sidebar\\\\Presentation\\\\View\\\\GroupRenderer\\:\\:render\\(\\) should return Illuminate\\\\Contracts\\\\View\\\\View\\|null but returns string\\.$#"
count: 1
path: packages/sidebar/src/Presentation/View/GroupRenderer.php

-
message: "#^Method Shopper\\\\Sidebar\\\\Presentation\\\\View\\\\ItemRenderer\\:\\:render\\(\\) should return Illuminate\\\\Contracts\\\\View\\\\View\\|null but returns string\\.$#"
count: 1
path: packages/sidebar/src/Presentation/View/ItemRenderer.php

0 comments on commit 7d62aa9

Please sign in to comment.