Changed else if to elseif (Followed PSR-2 standard)
This commit is contained in:
parent
1b8e383461
commit
f2df720bec
|
|
@ -173,7 +173,7 @@ class CartRuleDataGrid extends DataGrid
|
|||
'closure' => function ($value) {
|
||||
if ($value->status == 1) {
|
||||
return trans('admin::app.datagrid.active');
|
||||
} else if ($value->status == 0) {
|
||||
} elseif ($value->status == 0) {
|
||||
return trans('admin::app.datagrid.inactive');
|
||||
} else {
|
||||
return trans('admin::app.datagrid.draft');
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ class EmailTemplateDataGrid extends DataGrid
|
|||
'closure' => function ($value) {
|
||||
if ($value->status == 'active') {
|
||||
return trans('admin::app.datagrid.active');
|
||||
} else if ($value->status == 'inactive') {
|
||||
} elseif ($value->status == 'inactive') {
|
||||
return trans('admin::app.datagrid.inactive');
|
||||
} else if ($value->status == 'draft') {
|
||||
} elseif ($value->status == 'draft') {
|
||||
return trans('admin::app.datagrid.draft');
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@
|
|||
if (! this.idNullOption) {
|
||||
this.addOptionRow(true);
|
||||
}
|
||||
} else if(this.idNullOption !== null && typeof this.idNullOption !== 'undefined') {
|
||||
} elseif(this.idNullOption !== null && typeof this.idNullOption !== 'undefined') {
|
||||
const row = this.optionRows.find(optionRow => optionRow.id === this.idNullOption);
|
||||
this.removeRow(row);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@
|
|||
if (! this.idNullOption) {
|
||||
this.addOptionRow(true);
|
||||
}
|
||||
} else if(this.idNullOption !== null && typeof this.idNullOption !== 'undefined') {
|
||||
} elseif(this.idNullOption !== null && typeof this.idNullOption !== 'undefined') {
|
||||
const row = this.optionRows.find(optionRow => optionRow.id === this.idNullOption);
|
||||
this.removeRow(row);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
mounted () {
|
||||
if (this.image.id && this.image.url) {
|
||||
this.imageData = this.image.url;
|
||||
} else if (this.image.id && this.image.file) {
|
||||
} elseif (this.image.id && this.image.file) {
|
||||
this.readFile(this.image.file);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -521,7 +521,7 @@
|
|||
|
||||
if (image.id && image.url) {
|
||||
self.imageData.push(image.url);
|
||||
} else if (image.id && image.file) {
|
||||
} elseif (image.id && image.file) {
|
||||
self.readFile(image.file);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@
|
|||
mounted () {
|
||||
if (this.video.id && this.video.url) {
|
||||
this.videoData = this.video.url;
|
||||
} else if (this.video.id && this.video.file) {
|
||||
} elseif (this.video.id && this.video.file) {
|
||||
this.readFile(this.video.file);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
|
||||
if (dependValue == 'true') {
|
||||
dependValue = 1;
|
||||
} else if (dependValue == 'false') {
|
||||
} elseif (dependValue == 'false') {
|
||||
dependValue = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,15 +120,15 @@
|
|||
count = count + moveDown;
|
||||
|
||||
$('.navbar-left').css("top", count + "px");
|
||||
} else if ((event.keyCode == 40) && count >= -differenceInHeight) {
|
||||
} elseif ((event.keyCode == 40) && count >= -differenceInHeight) {
|
||||
count = count + moveUp;
|
||||
|
||||
$('.navbar-left').css("top", count + "px");
|
||||
} else if ((event.keyCode == 33) && countKeyUp <= 0) {
|
||||
} elseif ((event.keyCode == 33) && countKeyUp <= 0) {
|
||||
countKeyUp = countKeyUp + pageDown;
|
||||
|
||||
$('.navbar-left').css("top", countKeyUp + "px");
|
||||
} else if ((event.keyCode == 34) && countKeyUp >= -differenceInHeight) {
|
||||
} elseif ((event.keyCode == 34) && countKeyUp >= -differenceInHeight) {
|
||||
countKeyUp = countKeyUp + pageUp;
|
||||
|
||||
$('.navbar-left').css("top", countKeyUp + "px");
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class Cart
|
|||
'customer_id' => auth()->guard()->user()->id,
|
||||
'is_active' => 1,
|
||||
]);
|
||||
} else if (session()->has('cart')) {
|
||||
} elseif (session()->has('cart')) {
|
||||
$this->cart = $this->cartRepository->find(session()->get('cart')->id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,17 +29,17 @@ class NotificationRepository extends Repository
|
|||
$q->where(['status' => $params['status']]);
|
||||
});
|
||||
})->where('order_id', $params['id'])->with('order')->paginate(10) : $this->model->where('order_id', $params['id'])->with('order')->paginate(10) ;
|
||||
} else if (isset($params['status'])) {
|
||||
} elseif (isset($params['status'])) {
|
||||
return $params['status'] != 'All' ? $this->model->where(function($qry) use ($params) {
|
||||
$qry->whereHas('order',function ($q) use ($params) {
|
||||
$q->where(['status' => $params['status']]);
|
||||
});
|
||||
})->with('order')->paginate(10): $this->model->with('order')->latest()->paginate(10);
|
||||
} else if(isset($params['read']) && isset($params['limit'])) {
|
||||
} elseif(isset($params['read']) && isset($params['limit'])) {
|
||||
return $this->model->where('read', $params['read'])->limit($params['limit'])->with('order')->latest()->paginate($params['limit']);
|
||||
} else if(isset($params['limit'])) {
|
||||
} elseif(isset($params['limit'])) {
|
||||
return $this->model->limit($params['limit'])->with('order')->latest()->paginate($params['limit']);
|
||||
} else if(isset($params['id'])) {
|
||||
} elseif(isset($params['id'])) {
|
||||
return $this->model->where('order_id', $params['id'])->with('order')->paginate(10);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Transaction
|
|||
$this->orderTransactionRepository->create($transactionData);
|
||||
}
|
||||
}
|
||||
} else if ($invoice->order->payment->method == 'paypal_standard') {
|
||||
} elseif ($invoice->order->payment->method == 'paypal_standard') {
|
||||
$transactionData['transaction_id'] = $data['txn_id'];
|
||||
$transactionData['status'] = $data['payment_status'];
|
||||
$transactionData['type'] = $data['payment_type'];
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class Toolbar extends AbstractProduct
|
|||
|
||||
if (request()->input() == null && $key == $defaultMode) {
|
||||
return true;
|
||||
} else if (isset($params['mode']) && $key == $params['mode']) {
|
||||
} elseif (isset($params['mode']) && $key == $params['mode']) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class ProductFlat
|
|||
foreach ($product['channels'] as $channel) {
|
||||
$channels[] = $this->getChannel($channel)->code;
|
||||
}
|
||||
} else if (isset($parentProduct['channels'])){
|
||||
} elseif (isset($parentProduct['channels'])){
|
||||
foreach ($parentProduct['channels'] as $channel) {
|
||||
$channels[] = $this->getChannel($channel)->code;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ProductFlatRepository extends Repository
|
|||
if (! is_null($attribute[$key])) {
|
||||
if ($key == 'integer_value' && ! in_array($attribute[$key], $attributeInfo['attributeOptions'])) {
|
||||
array_push($attributeInfo['attributeOptions'], $attribute[$key]);
|
||||
} else if ($key == 'text_value' && ! in_array($attribute[$key], $attributeInfo['attributeOptions'])) {
|
||||
} elseif ($key == 'text_value' && ! in_array($attribute[$key], $attributeInfo['attributeOptions'])) {
|
||||
$multiSelectArrributes = explode(",", $attribute[$key]);
|
||||
|
||||
foreach ($multiSelectArrributes as $multi) {
|
||||
|
|
@ -108,7 +108,7 @@ class ProductFlatRepository extends Repository
|
|||
array_push($attributeInfo['attributeOptions'], $multi);
|
||||
}
|
||||
}
|
||||
} else if (($key == 'attribute_id' || $key == 'attributeId') && ! in_array($attribute[$key], $attributeInfo['attributes'])) {
|
||||
} elseif (($key == 'attribute_id' || $key == 'attributeId') && ! in_array($attribute[$key], $attributeInfo['attributes'])) {
|
||||
array_push($attributeInfo['attributes'], $attribute[$key]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ class ProductRepository extends Repository
|
|||
->where('visible_individually', 1)
|
||||
->orderBy('product_id', 'desc')
|
||||
->paginate(16);
|
||||
} else if (config('scout.driver') == 'elastic') {
|
||||
} elseif (config('scout.driver') == 'elastic') {
|
||||
$queries = explode('_', $term);
|
||||
|
||||
$results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries))
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@
|
|||
|
||||
if (operation == 'add') {
|
||||
quantity = parseInt(quantity) + 1;
|
||||
} else if (operation == 'remove') {
|
||||
} elseif (operation == 'remove') {
|
||||
if (quantity > 1) {
|
||||
quantity = parseInt(quantity) - 1;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -218,9 +218,9 @@
|
|||
if (result) {
|
||||
if (scope == 'address-form') {
|
||||
self.saveAddress();
|
||||
} else if (scope == 'shipping-form') {
|
||||
} elseif (scope == 'shipping-form') {
|
||||
self.saveShipping();
|
||||
} else if (scope == 'payment-form') {
|
||||
} elseif (scope == 'payment-form') {
|
||||
self.savePayment();
|
||||
}
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@
|
|||
if (response.status == 422) {
|
||||
serverErrors = response.data.errors;
|
||||
this.$root.addServerErrors(scope)
|
||||
} else if (response.status == 403) {
|
||||
} elseif (response.status == 403) {
|
||||
if (response.data.redirect_url) {
|
||||
window.location.href = response.data.redirect_url;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@
|
|||
|
||||
if (type == "multiple") {
|
||||
attributeItems = productDetails[attributeValues].split(',');
|
||||
} else if (type == "single") {
|
||||
} elseif (type == "single") {
|
||||
attributeItems = productDetails[attributeValues];
|
||||
}
|
||||
|
||||
|
|
@ -320,7 +320,7 @@
|
|||
if (attributeItems.indexOf(option.attribute_option_id.toString()) > -1) {
|
||||
return true;
|
||||
}
|
||||
} else if (type == "single") {
|
||||
} elseif (type == "single") {
|
||||
if (attributeItems == option.attribute_option_id.toString()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@
|
|||
$('#hammenu').addClass('icon-menu');
|
||||
$("#search-responsive").css("display", "block");
|
||||
$("#header-bottom").css("display", "none");
|
||||
} else if (currentElement.hasClass('icon-menu')) {
|
||||
} elseif (currentElement.hasClass('icon-menu')) {
|
||||
currentElement.removeClass('icon-menu');
|
||||
currentElement.addClass('icon-menu-close');
|
||||
$('#search').removeClass('icon-menu-close');
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@
|
|||
$('.responsive-layred-filter').css('display','none');
|
||||
$('.pager').css('display','flex');
|
||||
$('.pager').css('justify-content','space-between');
|
||||
} else if (currentElement.hasClass('filter-icon')) {
|
||||
} elseif (currentElement.hasClass('filter-icon')) {
|
||||
currentElement.removeClass('filter-icon');
|
||||
currentElement.addClass('icon-menu-close-adj');
|
||||
currentElement.prev().removeClass();
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ trait ProvideCollection
|
|||
} else {
|
||||
$record->{$column['index']} = htmlspecialchars($column['wrapper']($record));
|
||||
}
|
||||
} else if (isset($column['closure']) && gettype($column['closure']) === 'object' && $column['closure'] instanceof \Closure) {
|
||||
} elseif (isset($column['closure']) && gettype($column['closure']) === 'object' && $column['closure'] instanceof \Closure) {
|
||||
$record->{$column['index']} = $column['closure']($record);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ trait ProvideQueryResolver
|
|||
{
|
||||
if ($this->enableFilterMap && isset($this->filterMap[$columnName])) {
|
||||
$this->$method($collection, $this->filterMap[$columnName], $condition, $filterValue, $clause);
|
||||
} else if ($this->enableFilterMap && ! isset($this->filterMap[$columnName])) {
|
||||
} elseif ($this->enableFilterMap && ! isset($this->filterMap[$columnName])) {
|
||||
$this->$method($collection, $columnName, $condition, $filterValue, $clause);
|
||||
} else {
|
||||
$this->$method($collection, $columnName, $condition, $filterValue, $clause);
|
||||
|
|
@ -59,7 +59,7 @@ trait ProvideQueryResolver
|
|||
{
|
||||
if ($this->operators[$condition] == '=') {
|
||||
$this->checkFilterValueCondition($collection, $columnName, $condition, $filterValue);
|
||||
} else if ($this->operators[$condition] == '<>') {
|
||||
} elseif ($this->operators[$condition] == '<>') {
|
||||
$this->checkFilterValueCondition($collection, $columnName, $condition, $filterValue, true);
|
||||
} else {
|
||||
$this->resolveFilterQuery($collection, $columnName, $condition, $filterValue);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ trait ProvideQueryStringParser
|
|||
if (! is_array($value)) {
|
||||
unset($parsedQueryStrings[$key]);
|
||||
}
|
||||
} else if (! is_array($value)) {
|
||||
} elseif (! is_array($value)) {
|
||||
unset($parsedQueryStrings[$key]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@
|
|||
|
||||
if (this.type === 'string' && this.stringValue !== null) {
|
||||
this.formURL(this.columnOrAlias, this.stringCondition, encodeURIComponent(this.stringValue), label)
|
||||
} else if (this.type === 'number') {
|
||||
} elseif (this.type === 'number') {
|
||||
indexConditions = true;
|
||||
|
||||
if (this.filterIndex === this.columnOrAlias
|
||||
|
|
@ -444,11 +444,11 @@
|
|||
if (indexConditions) {
|
||||
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
|
||||
}
|
||||
} else if (this.type === 'boolean') {
|
||||
} elseif (this.type === 'boolean') {
|
||||
this.formURL(this.columnOrAlias, this.booleanCondition, this.booleanValue, label);
|
||||
} else if (this.type === 'datetime') {
|
||||
} elseif (this.type === 'datetime') {
|
||||
this.formURL(this.columnOrAlias, this.datetimeCondition, this.datetimeValue, label);
|
||||
} else if (this.type === 'price') {
|
||||
} elseif (this.type === 'price') {
|
||||
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
|
||||
}
|
||||
},
|
||||
|
|
@ -567,7 +567,7 @@
|
|||
alert('{{ __('ui::app.datagrid.filter-exists') }}');
|
||||
|
||||
return false;
|
||||
} else if (this.filters[j].cond === condition && this.filters[j].val !== response) {
|
||||
} elseif (this.filters[j].cond === condition && this.filters[j].val !== response) {
|
||||
filterRepeated = true;
|
||||
|
||||
this.filters[j].val = response;
|
||||
|
|
@ -699,7 +699,7 @@
|
|||
if (this.filters[i].column == 'status' || this.filters[i].column == 'value_per_locale' || this.filters[i].column == 'value_per_channel' || this.filters[i].column == 'is_unique') {
|
||||
if (this.filters[i].val.includes("True")) {
|
||||
this.filters[i].val = 1;
|
||||
} else if (this.filters[i].val.includes("False")) {
|
||||
} elseif (this.filters[i].val.includes("False")) {
|
||||
this.filters[i].val = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,13 +187,13 @@ class Helper extends Review
|
|||
if ($message['message'] = session('success')) {
|
||||
$message['messageType'] = 'alert-success';
|
||||
$message['messageLabel'] = __('velocity::app.shop.general.alert.success');
|
||||
} else if ($message['message'] = session('warning')) {
|
||||
} elseif ($message['message'] = session('warning')) {
|
||||
$message['messageType'] = 'alert-warning';
|
||||
$message['messageLabel'] = __('velocity::app.shop.general.alert.warning');
|
||||
} else if ($message['message'] = session('error')) {
|
||||
} elseif ($message['message'] = session('error')) {
|
||||
$message['messageType'] = 'alert-danger';
|
||||
$message['messageLabel'] = __('velocity::app.shop.general.alert.error');
|
||||
} else if ($message['message'] = session('info')) {
|
||||
} elseif ($message['message'] = session('info')) {
|
||||
$message['messageType'] = 'alert-info';
|
||||
$message['messageLabel'] = __('velocity::app.shop.general.alert.info');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class ShopController extends Controller
|
|||
|
||||
if ($slug == 'new-products') {
|
||||
$products = $this->velocityProductRepository->getNewProducts($count);
|
||||
} else if ($slug == 'featured-products') {
|
||||
} elseif ($slug == 'featured-products') {
|
||||
$products = $this->velocityProductRepository->getFeaturedProducts($count);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@
|
|||
if (response.status == 422) {
|
||||
serverErrors = response.data.errors;
|
||||
this.$root.addServerErrors(scope)
|
||||
} else if (response.status == 403) {
|
||||
} elseif (response.status == 403) {
|
||||
if (response.data.redirect_url) {
|
||||
window.location.href = response.data.redirect_url;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@
|
|||
|
||||
if (type == "multiple") {
|
||||
attributeItems = productDetails[attributeValues].split(',');
|
||||
} else if (type == "single") {
|
||||
} elseif (type == "single") {
|
||||
attributeItems = productDetails[attributeValues];
|
||||
}
|
||||
|
||||
|
|
@ -278,7 +278,7 @@
|
|||
if (attributeItems.indexOf(option.attribute_option_id.toString()) > -1) {
|
||||
return true;
|
||||
}
|
||||
} else if (type == "single") {
|
||||
} elseif (type == "single") {
|
||||
if (attributeItems == option.attribute_option_id.toString()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue