- Final CS fixes.

This commit is contained in:
Abdullah Al-Faqeir 2021-10-06 16:52:20 +03:00
parent 8e3c43bd19
commit 865d0736d4
3 changed files with 16 additions and 14 deletions

View File

@ -259,7 +259,7 @@ class Laravel5Helper extends Laravel
private function haveBookingEventProduct(array $configs = [], array $productStates = []): Product
{
$I = $this;
if (!in_array('booking', $productStates)) {
if (! in_array('booking', $productStates)) {
$productStates = array_merge($productStates, ['booking']);
}

View File

@ -8,7 +8,9 @@ use Webkul\Core\Eloquent\TranslatableModel;
use Webkul\Inventory\Models\InventorySourceProxy;
use Webkul\Core\Database\Factories\ChannelFactory;
use Webkul\Core\Contracts\Channel as ChannelContract;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Channel extends TranslatableModel implements ChannelContract
{
@ -43,7 +45,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* Get the channel locales.
*/
public function locales(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
public function locales(): BelongsToMany
{
return $this->belongsToMany(LocaleProxy::modelClass(), 'channel_locales');
}
@ -51,7 +53,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* Get the default locale
*/
public function default_locale(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function default_locale(): BelongsTo
{
return $this->belongsTo(LocaleProxy::modelClass());
}
@ -59,7 +61,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* Get the channel locales.
*/
public function currencies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
public function currencies(): BelongsToMany
{
return $this->belongsToMany(CurrencyProxy::modelClass(), 'channel_currencies');
}
@ -67,7 +69,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* 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');
}
@ -75,7 +77,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* Get the base currency
*/
public function base_currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function base_currency(): BelongsTo
{
return $this->belongsTo(CurrencyProxy::modelClass());
}
@ -83,7 +85,7 @@ class Channel extends TranslatableModel implements ChannelContract
/**
* 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');
}
@ -93,7 +95,7 @@ class Channel extends TranslatableModel implements ChannelContract
*/
public function logo_url()
{
if (!$this->logo) {
if (! $this->logo) {
return;
}
@ -113,7 +115,7 @@ class Channel extends TranslatableModel implements ChannelContract
*/
public function favicon_url()
{
if (!$this->favicon) {
if (! $this->favicon) {
return;
}

View File

@ -302,7 +302,7 @@ class Product extends Model implements ProductContract
$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.");
}
@ -372,13 +372,13 @@ class Product extends Model implements ProductContract
*/
public function getAttribute($key)
{
if (!method_exists(static::class, $key)
&& !in_array($key, [
if (! method_exists(static::class, $key)
&& ! in_array($key, [
'pivot',
'parent_id',
'attribute_family_id',
])
&& !isset($this->attributes[$key])) {
&& ! isset($this->attributes[$key])) {
if (isset($this->id)) {
$this->attributes[$key] = '';
@ -417,7 +417,7 @@ class Product extends Model implements ProductContract
*/
public function getCustomAttributeValue($attribute)
{
if (!$attribute) {
if (! $attribute) {
return;
}