Apply PHP Code Styling & Quality Changes (#1617)

This commit is contained in:
FOSSBilling Bot authored and GitHub committed 2023-09-19 17:22:00 +03:00
1 parent e07b4a2b08
commit 1970b320e1
5 files changed
+9 -7

No files matched your search

+1 -1
View File
@@ -170,7 +170,7 @@ class Service implements InjectionAwareInterface
if (!empty($where)) {
$sql .= ' WHERE ' . implode(' AND ', $where);
}
$sql = $sql . ' ORDER BY c.created_at desc';
$sql .= ' ORDER BY c.created_at desc';
return [$sql, $params];
}
+5 -3
View File
@@ -220,9 +220,10 @@ class Service implements \FOSSBilling\InjectionAwareInterface
{
// Add the email to the queue
$email = $this->_queue($to, $from, $subject, $content, $to_name, $from_name, $client_id, $admin_id);
if($send_now){
if ($send_now) {
$this->_sendFromQueue($email, $throw_exceptions);
}
return true;
}
@@ -629,9 +630,10 @@ class Service implements \FOSSBilling\InjectionAwareInterface
$this->di['db']->trash($queue);
}
if($throw_exceptions){
if ($throw_exceptions) {
// If the error message is long, truncate it and inform the user the rest is in the error log.
$truncated = (strlen($message) > 350) ? __trans('Error message truncated due to length, please check the error log for the complete message: ') . substr($message,0,350).'...' : $message;
$truncated = (strlen($message) > 350) ? __trans('Error message truncated due to length, please check the error log for the complete message: ') . substr($message, 0, 350) . '...' : $message;
throw new \Box_Exception($truncated);
}
}
+1 -1
View File
@@ -208,7 +208,7 @@ class Service
$sql = $sql . ' WHERE ' . implode(' AND ', $where);
}
$sql = $sql . ' GROUP BY kac.id ORDER BY kac.id DESC';
$sql .= ' GROUP BY kac.id ORDER BY kac.id DESC';
return [$sql, $bindings];
}
+1 -1
View File
@@ -798,7 +798,7 @@ class Service implements InjectionAwareInterface
public function stockSale(\Model_Product $product, $qty)
{
if ($product->stock_control) {
$product->quantity_in_stock = $product->quantity_in_stock - $qty;
$product->quantity_in_stock -= $qty;
$product->updated_at = date('Y-m-d H:i:s');
$this->di['db']->store($product);
}
+1 -1
View File
@@ -825,7 +825,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
$query = $query . ' WHERE ' . implode(' AND ', $where);
}
$query = $query . ' ORDER BY id ASC';
$query .= ' ORDER BY id ASC';
return [$query, $bindings];
}