diff --git a/phpstan.neon.dist b/phpstan.neon.dist index c3cb47ab..4b5fcf3f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,12 +1,15 @@ includes: - - vendor/nunomaduro/larastan/extension.neon + - vendor/larastan/larastan/extension.neon parameters: - level: 5 - checkMissingIterableValueType: false paths: - src/ - config/ - database/ - routes/ + databaseMigrationsPath: + - database/migrations/ + - vendor/orchestra/testbench-core/laravel/migrations/ + level: 5 + checkMissingIterableValueType: false ignoreErrors: - - '#^Unsafe usage of new static#' + - '#^Access to an undefined property Illuminate\\Database\\Eloquent\\Model::#' diff --git a/src/Interfaces/Itemable.php b/src/Interfaces/Itemable.php index a5edb4a8..de460881 100644 --- a/src/Interfaces/Itemable.php +++ b/src/Interfaces/Itemable.php @@ -75,8 +75,6 @@ public function findItem(array $attributes): ?Item; /** * Merge the given item into the collection. - * - * @param \Cone\Bazar\Models\Item $items */ public function mergeItem(Item $item): Item; diff --git a/src/Models/Address.php b/src/Models/Address.php index 71affbec..921ed4f0 100644 --- a/src/Models/Address.php +++ b/src/Models/Address.php @@ -136,6 +136,8 @@ public function addressable(): MorphTo /** * Get the alias attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function alias(): Attribute { @@ -148,6 +150,8 @@ protected function alias(): Attribute /** * Get the name attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function name(): Attribute { diff --git a/src/Models/Item.php b/src/Models/Item.php index ac805c4c..512a4e4d 100644 --- a/src/Models/Item.php +++ b/src/Models/Item.php @@ -129,6 +129,8 @@ public function itemable(): MorphTo /** * Get the formatted price attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedPrice(): Attribute { @@ -139,6 +141,8 @@ protected function formattedPrice(): Attribute /** * Get the total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function total(): Attribute { @@ -149,6 +153,8 @@ protected function total(): Attribute /** * Get the formatted total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedTotal(): Attribute { @@ -159,6 +165,8 @@ protected function formattedTotal(): Attribute /** * Get the subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function subtotal(): Attribute { @@ -169,6 +177,8 @@ protected function subtotal(): Attribute /** * Get the formatted subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedSubtotal(): Attribute { diff --git a/src/Models/Order.php b/src/Models/Order.php index 675b97dd..f6cef51f 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -161,6 +161,8 @@ public function transactions(): HasMany /** * Get the payments attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Illuminate\Support\Collection, never> */ protected function payments(): Attribute { @@ -173,6 +175,8 @@ protected function payments(): Attribute /** * Get the refunds attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Illuminate\Support\Collection, never> */ protected function refunds(): Attribute { @@ -185,6 +189,8 @@ protected function refunds(): Attribute /** * Get the status name attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function statusName(): Attribute { diff --git a/src/Models/Price.php b/src/Models/Price.php index 69603c1b..1e5a90ad 100644 --- a/src/Models/Price.php +++ b/src/Models/Price.php @@ -34,6 +34,8 @@ public static function formatCurrency(string $currency, Closure $callback): void /** * Get the currency attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function currency(): Attribute { @@ -46,6 +48,8 @@ protected function currency(): Attribute /** * Get the currency symbol attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function symbol(): Attribute { diff --git a/src/Models/Shipping.php b/src/Models/Shipping.php index 61cae695..038b38c5 100644 --- a/src/Models/Shipping.php +++ b/src/Models/Shipping.php @@ -107,6 +107,8 @@ public function shippable(): MorphTo /** * Get the driver attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function driver(): Attribute { @@ -119,6 +121,8 @@ protected function driver(): Attribute /** * Get the total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function total(): Attribute { @@ -131,6 +135,8 @@ protected function total(): Attribute /** * Get the formatted total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedTotal(): Attribute { @@ -143,6 +149,8 @@ protected function formattedTotal(): Attribute /** * Get the subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function subtotal(): Attribute { @@ -155,6 +163,8 @@ protected function subtotal(): Attribute /** * Get the formatted subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedSubtotal(): Attribute { @@ -167,6 +177,8 @@ protected function formattedSubtotal(): Attribute /** * Get the name of the shipping method. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function driverName(): Attribute { diff --git a/src/Models/Transaction.php b/src/Models/Transaction.php index 82b955e0..1aa51f0a 100644 --- a/src/Models/Transaction.php +++ b/src/Models/Transaction.php @@ -99,6 +99,8 @@ public function order(): BelongsTo /** * Get the name of the gateway driver. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function driverName(): Attribute { @@ -115,6 +117,8 @@ protected function driverName(): Attribute /** * Get the URL of the transaction. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function url(): Attribute { diff --git a/src/Models/Variant.php b/src/Models/Variant.php index ca3a8f49..faf83dcb 100644 --- a/src/Models/Variant.php +++ b/src/Models/Variant.php @@ -85,6 +85,8 @@ public function product(): BelongsTo /** * Get the alias attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function alias(): Attribute { diff --git a/src/Traits/HasPrices.php b/src/Traits/HasPrices.php index adc5c700..110f3a48 100644 --- a/src/Traits/HasPrices.php +++ b/src/Traits/HasPrices.php @@ -24,6 +24,8 @@ public function prices(): Prices /** * Get the price attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function price(): Attribute { @@ -34,6 +36,8 @@ protected function price(): Attribute /** * Get the formatted price attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedPrice(): Attribute { diff --git a/src/Traits/InteractsWithDiscounts.php b/src/Traits/InteractsWithDiscounts.php index 3b3f616a..6d78e1b7 100644 --- a/src/Traits/InteractsWithDiscounts.php +++ b/src/Traits/InteractsWithDiscounts.php @@ -10,6 +10,8 @@ trait InteractsWithDiscounts { /** * Get the formatted discount attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedDiscount(): Attribute { diff --git a/src/Traits/InteractsWithItems.php b/src/Traits/InteractsWithItems.php index 75e0a818..9f260454 100644 --- a/src/Traits/InteractsWithItems.php +++ b/src/Traits/InteractsWithItems.php @@ -62,6 +62,8 @@ public function shipping(): MorphOne /** * Get the currency attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function currency(): Attribute { @@ -74,6 +76,8 @@ protected function currency(): Attribute /** * Get the line items attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Illuminate\Support\Collection, never> */ protected function lineItems(): Attribute { @@ -86,6 +90,8 @@ protected function lineItems(): Attribute /** * Get the fees attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Illuminate\Support\Collection, never> */ protected function fees(): Attribute { @@ -98,6 +104,8 @@ protected function fees(): Attribute /** * Get the taxables attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Illuminate\Support\Collection, never> */ protected function taxables(): Attribute { @@ -112,6 +120,8 @@ protected function taxables(): Attribute /** * Get the total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function total(): Attribute { @@ -124,6 +134,8 @@ protected function total(): Attribute /** * Get the formatted total attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedTotal(): Attribute { @@ -136,6 +148,8 @@ protected function formattedTotal(): Attribute /** * Get the subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function subtotal(): Attribute { @@ -148,6 +162,8 @@ protected function subtotal(): Attribute /** * Get the formatted subtotal attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedSubtotal(): Attribute { @@ -160,6 +176,8 @@ protected function formattedSubtotal(): Attribute /** * Get the tax attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function tax(): Attribute { @@ -172,6 +190,8 @@ protected function tax(): Attribute /** * Get the formatted tax attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedTax(): Attribute { diff --git a/src/Traits/InteractsWithTaxes.php b/src/Traits/InteractsWithTaxes.php index 3319f4b9..8c29e728 100644 --- a/src/Traits/InteractsWithTaxes.php +++ b/src/Traits/InteractsWithTaxes.php @@ -13,6 +13,8 @@ trait InteractsWithTaxes { /** * Get the formatted tax attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function formattedTax(): Attribute {