- Final CS fixes.
This commit is contained in:
parent
8e3c43bd19
commit
865d0736d4
|
|
@ -259,7 +259,7 @@ class Laravel5Helper extends Laravel
|
||||||
private function haveBookingEventProduct(array $configs = [], array $productStates = []): Product
|
private function haveBookingEventProduct(array $configs = [], array $productStates = []): Product
|
||||||
{
|
{
|
||||||
$I = $this;
|
$I = $this;
|
||||||
if (!in_array('booking', $productStates)) {
|
if (! in_array('booking', $productStates)) {
|
||||||
$productStates = array_merge($productStates, ['booking']);
|
$productStates = array_merge($productStates, ['booking']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@ use Webkul\Core\Eloquent\TranslatableModel;
|
||||||
use Webkul\Inventory\Models\InventorySourceProxy;
|
use Webkul\Inventory\Models\InventorySourceProxy;
|
||||||
use Webkul\Core\Database\Factories\ChannelFactory;
|
use Webkul\Core\Database\Factories\ChannelFactory;
|
||||||
use Webkul\Core\Contracts\Channel as ChannelContract;
|
use Webkul\Core\Contracts\Channel as ChannelContract;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
|
|
||||||
class Channel extends TranslatableModel implements ChannelContract
|
class Channel extends TranslatableModel implements ChannelContract
|
||||||
{
|
{
|
||||||
|
|
@ -43,7 +45,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the channel locales.
|
* Get the channel locales.
|
||||||
*/
|
*/
|
||||||
public function locales(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function locales(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(LocaleProxy::modelClass(), 'channel_locales');
|
return $this->belongsToMany(LocaleProxy::modelClass(), 'channel_locales');
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +53,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the default locale
|
* Get the default locale
|
||||||
*/
|
*/
|
||||||
public function default_locale(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function default_locale(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(LocaleProxy::modelClass());
|
return $this->belongsTo(LocaleProxy::modelClass());
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +61,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the channel locales.
|
* Get the channel locales.
|
||||||
*/
|
*/
|
||||||
public function currencies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function currencies(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(CurrencyProxy::modelClass(), 'channel_currencies');
|
return $this->belongsToMany(CurrencyProxy::modelClass(), 'channel_currencies');
|
||||||
}
|
}
|
||||||
|
|
@ -67,7 +69,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the channel inventory sources.
|
* Get the channel inventory sources.
|
||||||
*/
|
*/
|
||||||
public function inventory_sources(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function inventory_sources(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(InventorySourceProxy::modelClass(), 'channel_inventory_sources');
|
return $this->belongsToMany(InventorySourceProxy::modelClass(), 'channel_inventory_sources');
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +77,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the base currency
|
* Get the base currency
|
||||||
*/
|
*/
|
||||||
public function base_currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function base_currency(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(CurrencyProxy::modelClass());
|
return $this->belongsTo(CurrencyProxy::modelClass());
|
||||||
}
|
}
|
||||||
|
|
@ -83,7 +85,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
/**
|
/**
|
||||||
* Get the base currency
|
* Get the base currency
|
||||||
*/
|
*/
|
||||||
public function root_category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function root_category(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(CategoryProxy::modelClass(), 'root_category_id');
|
return $this->belongsTo(CategoryProxy::modelClass(), 'root_category_id');
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +95,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
*/
|
*/
|
||||||
public function logo_url()
|
public function logo_url()
|
||||||
{
|
{
|
||||||
if (!$this->logo) {
|
if (! $this->logo) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +115,7 @@ class Channel extends TranslatableModel implements ChannelContract
|
||||||
*/
|
*/
|
||||||
public function favicon_url()
|
public function favicon_url()
|
||||||
{
|
{
|
||||||
if (!$this->favicon) {
|
if (! $this->favicon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ class Product extends Model implements ProductContract
|
||||||
|
|
||||||
$this->typeInstance = app(config('product_types.' . $this->type . '.class'));
|
$this->typeInstance = app(config('product_types.' . $this->type . '.class'));
|
||||||
|
|
||||||
if (!$this->typeInstance instanceof AbstractType) {
|
if (! $this->typeInstance instanceof AbstractType) {
|
||||||
throw new Exception("Please ensure the product type '{$this->type}' is configured in your application.");
|
throw new Exception("Please ensure the product type '{$this->type}' is configured in your application.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -372,13 +372,13 @@ class Product extends Model implements ProductContract
|
||||||
*/
|
*/
|
||||||
public function getAttribute($key)
|
public function getAttribute($key)
|
||||||
{
|
{
|
||||||
if (!method_exists(static::class, $key)
|
if (! method_exists(static::class, $key)
|
||||||
&& !in_array($key, [
|
&& ! in_array($key, [
|
||||||
'pivot',
|
'pivot',
|
||||||
'parent_id',
|
'parent_id',
|
||||||
'attribute_family_id',
|
'attribute_family_id',
|
||||||
])
|
])
|
||||||
&& !isset($this->attributes[$key])) {
|
&& ! isset($this->attributes[$key])) {
|
||||||
if (isset($this->id)) {
|
if (isset($this->id)) {
|
||||||
$this->attributes[$key] = '';
|
$this->attributes[$key] = '';
|
||||||
|
|
||||||
|
|
@ -417,7 +417,7 @@ class Product extends Model implements ProductContract
|
||||||
*/
|
*/
|
||||||
public function getCustomAttributeValue($attribute)
|
public function getCustomAttributeValue($attribute)
|
||||||
{
|
{
|
||||||
if (!$attribute) {
|
if (! $attribute) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue