- Fixing coding style.

- Fixing typo.
This commit is contained in:
Abdullah Al-Faqeir 2021-10-06 15:26:08 +03:00
parent 7b612ecc67
commit 8e3c43bd19
57 changed files with 641 additions and 677 deletions

View File

@ -13,12 +13,12 @@ namespace Database\Factories;
| |
*/ */
class UserFactory extends \Illuminate\Database\Eloquent\Factories\Factory use Illuminate\Database\Eloquent\Factories\Factory;
{
class UserFactory extends Factory
{
public function definition(): array public function definition(): array
{ {
return []; return [];
} }
} }

View File

@ -6,15 +6,13 @@ use Illuminate\Http\Resources\Json\JsonResource;
class Attribute extends JsonResource class Attribute extends JsonResource
{ {
/** /**
* Transform the resource into an array. * Transform the resource into an array.
* *
* @param \Illuminate\Http\Request * @param \Illuminate\Http\Request
*
* @return array * @return array
*/ */
public function toArray($request) public function toArray($request): array
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
@ -27,5 +25,4 @@ class Attribute extends JsonResource
'updated_at' => $this->updated_at, 'updated_at' => $this->updated_at,
]; ];
} }
} }

View File

@ -6,15 +6,13 @@ use Illuminate\Http\Resources\Json\JsonResource;
class AttributeOption extends JsonResource class AttributeOption extends JsonResource
{ {
/** /**
* Transform the resource into an array. * Transform the resource into an array.
* *
* @param \Illuminate\Http\Request * @param \Illuminate\Http\Request
*
* @return array * @return array
*/ */
public function toArray($request) public function toArray($request): array
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
@ -23,5 +21,4 @@ class AttributeOption extends JsonResource
'swatch_value' => $this->swatch_value, 'swatch_value' => $this->swatch_value,
]; ];
} }
} }

View File

@ -40,7 +40,7 @@ class AttributeOption extends TranslatableModel implements AttributeOptionContra
return url('cache/small/' . $this->swatch_value); return url('cache/small/' . $this->swatch_value);
} }
return; return null;
} }
/** /**

View File

@ -6,7 +6,6 @@ use Illuminate\Support\ServiceProvider;
class AttributeServiceProvider extends ServiceProvider class AttributeServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
* *
@ -16,5 +15,4 @@ class AttributeServiceProvider extends ServiceProvider
{ {
$this->loadMigrationsFrom(__DIR__.'/../Database/Migrations'); $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
} }
} }

View File

@ -6,7 +6,6 @@ use Illuminate\Support\ServiceProvider;
class BookingProductServiceProvider extends ServiceProvider class BookingProductServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
* *
@ -38,5 +37,4 @@ class BookingProductServiceProvider extends ServiceProvider
{ {
$this->mergeConfigFrom(dirname(__DIR__) . '/Config/product_types.php', 'product_types'); $this->mergeConfigFrom(dirname(__DIR__) . '/Config/product_types.php', 'product_types');
} }
} }

View File

@ -14,7 +14,6 @@ use Webkul\Category\Contracts\CategoryTranslation as CategoryTranslationContract
*/ */
class CategoryTranslation extends Model implements CategoryTranslationContract class CategoryTranslation extends Model implements CategoryTranslationContract
{ {
public $timestamps = false; public $timestamps = false;
protected $fillable = [ protected $fillable = [
@ -26,5 +25,4 @@ class CategoryTranslation extends Model implements CategoryTranslationContract
'meta_keywords', 'meta_keywords',
'locale_id', 'locale_id',
]; ];
} }

View File

@ -8,7 +8,6 @@ use Webkul\Checkout\Facades\Cart;
class CheckoutServiceProvider extends ServiceProvider class CheckoutServiceProvider extends ServiceProvider
{ {
public function boot(): void public function boot(): void
{ {
include __DIR__ . '/../Http/helpers.php'; include __DIR__ . '/../Http/helpers.php';
@ -49,5 +48,4 @@ class CheckoutServiceProvider extends ServiceProvider
$this->app->bind('cart', 'Webkul\Checkout\Cart'); $this->app->bind('cart', 'Webkul\Checkout\Cart');
} }
} }

View File

@ -145,7 +145,7 @@ class Core
} }
/** /**
* Returns currenct channel models. * Returns current channel models.
* *
* @return \Webkul\Core\Contracts\Channel * @return \Webkul\Core\Contracts\Channel
*/ */

View File

@ -32,7 +32,6 @@ use Webkul\Product\Models\ProductDownloadableLinkTranslation;
*/ */
class Laravel5Helper extends Laravel class Laravel5Helper extends Laravel
{ {
public const SIMPLE_PRODUCT = 1; public const SIMPLE_PRODUCT = 1;
public const VIRTUAL_PRODUCT = 2; public const VIRTUAL_PRODUCT = 2;
@ -451,5 +450,4 @@ class Laravel5Helper extends Laravel
return $data; return $data;
} }
} }

View File

@ -1,9 +1,7 @@
<?php <?php
namespace Webkul\Core\Models; namespace Webkul\Core\Models;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -12,7 +10,6 @@ use Webkul\Core\Contracts\Address as AddressContract;
/** /**
* Class Address * Class Address
*
* @package Webkul\Core\Models * @package Webkul\Core\Models
* *
* @property string $address_type * @property string $address_type
@ -41,7 +38,6 @@ use Webkul\Core\Contracts\Address as AddressContract;
*/ */
abstract class Address extends Model implements AddressContract abstract class Address extends Model implements AddressContract
{ {
protected $table = 'addresses'; protected $table = 'addresses';
protected $guarded = [ protected $guarded = [
@ -92,5 +88,4 @@ abstract class Address extends Model implements AddressContract
{ {
return $this->belongsTo(Customer::class); return $this->belongsTo(Customer::class);
} }
} }

View File

@ -6,7 +6,7 @@ use Konekt\Concord\BaseModuleServiceProvider;
class CoreModuleServiceProvider extends BaseModuleServiceProvider class CoreModuleServiceProvider extends BaseModuleServiceProvider
{ {
public function boot() public function boot(): void
{ {
if ($this->areMigrationsEnabled()) { if ($this->areMigrationsEnabled()) {
$this->registerMigrations(); $this->registerMigrations();

View File

@ -17,7 +17,6 @@ use Webkul\Theme\ViewRenderEventManager;
class CoreServiceProvider extends ServiceProvider class CoreServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
* *
@ -127,5 +126,4 @@ class CoreServiceProvider extends ServiceProvider
return new BladeCompiler($app['files'], $app['config']['view.compiled']); return new BladeCompiler($app['files'], $app['config']['view.compiled']);
}); });
} }
} }

View File

@ -3,6 +3,7 @@
namespace Webkul\Customer\Models; namespace Webkul\Customer\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Webkul\Customer\Database\Factories\CustomerGroupFactory; use Webkul\Customer\Database\Factories\CustomerGroupFactory;
use Webkul\Customer\Contracts\CustomerGroup as CustomerGroupContract; use Webkul\Customer\Contracts\CustomerGroup as CustomerGroupContract;
@ -22,7 +23,7 @@ class CustomerGroup extends Model implements CustomerGroupContract
/** /**
* Get the customers for this group. * Get the customers for this group.
*/ */
public function customers(): \Illuminate\Database\Eloquent\Relations\HasMany public function customers(): HasMany
{ {
return $this->hasMany(CustomerProxy::modelClass()); return $this->hasMany(CustomerProxy::modelClass());
} }

View File

@ -10,13 +10,13 @@ use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
class CustomerServiceProvider extends ServiceProvider class CustomerServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap application services. * Bootstrap application services.
* *
* @param \Illuminate\Routing\Router $router
* @return void * @return void
*/ */
public function boot(Router $router) public function boot(Router $router): void
{ {
$router->aliasMiddleware('customer', RedirectIfNotCustomer::class); $router->aliasMiddleware('customer', RedirectIfNotCustomer::class);
@ -54,5 +54,4 @@ class CustomerServiceProvider extends ServiceProvider
{ {
$this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core'); $this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core');
} }
} }

View File

@ -6,7 +6,6 @@ use Illuminate\Support\ServiceProvider;
class InventoryServiceProvider extends ServiceProvider class InventoryServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
* *
@ -25,5 +24,4 @@ class InventoryServiceProvider extends ServiceProvider
public function register(): void public function register(): void
{ {
} }
} }

View File

@ -1,13 +1,13 @@
<?php <?php
namespace Webkul\Category\Database\Seeders; namespace Webkul\Product\Database\Seeders;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class ProductTableSeeder extends Seeder class ProductTableSeeder extends Seeder
{ {
public function run() public function run(): void
{ {
//dd('running'); //dd('running');
} }

View File

@ -15,7 +15,6 @@ use Webkul\Product\ProductVideo;
class ProductServiceProvider extends ServiceProvider class ProductServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
* *
@ -97,5 +96,4 @@ class ProductServiceProvider extends ServiceProvider
return app()->make(ProductVideo::class); return app()->make(ProductVideo::class);
}); });
} }
} }

View File

@ -6,6 +6,10 @@ use Webkul\Checkout\Models\CartProxy;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Webkul\Sales\Contracts\Order as OrderContract; use Webkul\Sales\Contracts\Order as OrderContract;
use Webkul\Sales\Database\Factories\OrderFactory; use Webkul\Sales\Database\Factories\OrderFactory;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
class Order extends Model implements OrderContract class Order extends Model implements OrderContract
@ -83,7 +87,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the associated cart that was used to create this order. * Get the associated cart that was used to create this order.
*/ */
public function cart(): \Illuminate\Database\Eloquent\Relations\BelongsTo public function cart(): BelongsTo
{ {
return $this->belongsTo(CartProxy::modelClass()); return $this->belongsTo(CartProxy::modelClass());
} }
@ -91,7 +95,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order items record associated with the order. * Get the order items record associated with the order.
*/ */
public function items(): \Illuminate\Database\Eloquent\Relations\HasMany public function items(): HasMany
{ {
return $this->hasMany(OrderItemProxy::modelClass()) return $this->hasMany(OrderItemProxy::modelClass())
->whereNull('parent_id'); ->whereNull('parent_id');
@ -100,7 +104,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the comments record associated with the order. * Get the comments record associated with the order.
*/ */
public function comments(): \Illuminate\Database\Eloquent\Relations\HasMany public function comments(): HasMany
{ {
return $this->hasMany(OrderCommentProxy::modelClass()); return $this->hasMany(OrderCommentProxy::modelClass());
} }
@ -108,7 +112,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order items record associated with the order. * Get the order items record associated with the order.
*/ */
public function all_items(): \Illuminate\Database\Eloquent\Relations\HasMany public function all_items(): HasMany
{ {
return $this->hasMany(OrderItemProxy::modelClass()); return $this->hasMany(OrderItemProxy::modelClass());
} }
@ -116,7 +120,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order shipments record associated with the order. * Get the order shipments record associated with the order.
*/ */
public function shipments(): \Illuminate\Database\Eloquent\Relations\HasMany public function shipments(): HasMany
{ {
return $this->hasMany(ShipmentProxy::modelClass()); return $this->hasMany(ShipmentProxy::modelClass());
} }
@ -124,7 +128,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order invoices record associated with the order. * Get the order invoices record associated with the order.
*/ */
public function invoices(): \Illuminate\Database\Eloquent\Relations\HasMany public function invoices(): HasMany
{ {
return $this->hasMany(InvoiceProxy::modelClass()); return $this->hasMany(InvoiceProxy::modelClass());
} }
@ -132,7 +136,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order refunds record associated with the order. * Get the order refunds record associated with the order.
*/ */
public function refunds(): \Illuminate\Database\Eloquent\Relations\HasMany public function refunds(): HasMany
{ {
return $this->hasMany(RefundProxy::modelClass()); return $this->hasMany(RefundProxy::modelClass());
} }
@ -140,7 +144,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the order transactions record associated with the order. * Get the order transactions record associated with the order.
*/ */
public function transactions(): \Illuminate\Database\Eloquent\Relations\HasMany public function transactions(): HasMany
{ {
return $this->hasMany(OrderTransactionProxy::modelClass()); return $this->hasMany(OrderTransactionProxy::modelClass());
} }
@ -148,7 +152,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the customer record associated with the order. * Get the customer record associated with the order.
*/ */
public function customer(): \Illuminate\Database\Eloquent\Relations\MorphTo public function customer(): MorphTo
{ {
return $this->morphTo(); return $this->morphTo();
} }
@ -156,7 +160,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the addresses for the order. * Get the addresses for the order.
*/ */
public function addresses(): \Illuminate\Database\Eloquent\Relations\HasMany public function addresses(): HasMany
{ {
return $this->hasMany(OrderAddressProxy::modelClass()); return $this->hasMany(OrderAddressProxy::modelClass());
} }
@ -164,7 +168,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the payment for the order. * Get the payment for the order.
*/ */
public function payment(): \Illuminate\Database\Eloquent\Relations\HasOne public function payment(): HasOne
{ {
return $this->hasOne(OrderPaymentProxy::modelClass()); return $this->hasOne(OrderPaymentProxy::modelClass());
} }
@ -172,7 +176,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the billing address for the order. * Get the billing address for the order.
*/ */
public function billing_address(): \Illuminate\Database\Eloquent\Relations\HasMany public function billing_address(): HasMany
{ {
return $this->addresses() return $this->addresses()
->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING); ->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING);
@ -190,7 +194,7 @@ class Order extends Model implements OrderContract
/** /**
* Get the shipping address for the order. * Get the shipping address for the order.
*/ */
public function shipping_address(): \Illuminate\Database\Eloquent\Relations\HasMany public function shipping_address(): HasMany
{ {
return $this->addresses() return $this->addresses()
->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING); ->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING);

View File

@ -6,7 +6,6 @@ use Illuminate\Support\ServiceProvider;
class SalesServiceProvider extends ServiceProvider class SalesServiceProvider extends ServiceProvider
{ {
public function boot(): void public function boot(): void
{ {
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
@ -21,5 +20,4 @@ class SalesServiceProvider extends ServiceProvider
{ {
$this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core'); $this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core');
} }
} }

View File

@ -25,7 +25,6 @@ use Cart;
class cartRuleWithCoupon class cartRuleWithCoupon
{ {
public $cartRule; public $cartRule;
public $coupon; public $coupon;
@ -35,12 +34,10 @@ class cartRuleWithCoupon
$this->cartRule = $cartRule; $this->cartRule = $cartRule;
$this->coupon = $coupon; $this->coupon = $coupon;
} }
} }
class expectedCartItem implements Arrayable class expectedCartItem implements Arrayable
{ {
public const ITEM_DISCOUNT_AMOUNT_PRECISION = 4; public const ITEM_DISCOUNT_AMOUNT_PRECISION = 4;
public const ITEM_TAX_AMOUNT_PRECISION = 4; public const ITEM_TAX_AMOUNT_PRECISION = 4;
@ -130,12 +127,10 @@ class expectedCartItem implements Arrayable
'applied_cart_rule_ids' => $this->applied_cart_rule_ids, 'applied_cart_rule_ids' => $this->applied_cart_rule_ids,
]; ];
} }
} }
class expectedCart class expectedCart
{ {
public const CART_TOTAL_PRECISION = 2; public const CART_TOTAL_PRECISION = 2;
public $customer_id; public $customer_id;
@ -195,12 +190,10 @@ class expectedCart
{ {
return (array)$this; return (array)$this;
} }
} }
class expectedOrder implements Arrayable class expectedOrder implements Arrayable
{ {
public $status; public $status;
public $customer_email; public $customer_email;
@ -298,12 +291,10 @@ class expectedOrder implements Arrayable
'shipping_discount_amount' => $this->shipping_discount_amount, 'shipping_discount_amount' => $this->shipping_discount_amount,
]; ];
} }
} }
class CartRuleCest class CartRuleCest
{ {
private $products; private $products;
private $sessionToken; private $sessionToken;
@ -1251,6 +1242,4 @@ class CartRuleCest
return null; return null;
} }
} }