From 80b85d5c2171390552364c46efe91ebf95b438b2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 30 Nov 2023 17:59:17 +1100 Subject: [PATCH] php cs fixes --- app/DataMapper/Schedule/EmailReport.php | 16 ++++++++-------- app/Http/Controllers/BaseController.php | 6 ++---- app/Http/Controllers/PreviewController.php | 2 +- app/Http/Controllers/SearchController.php | 2 +- app/Jobs/Expense/VendorExpenseNotify.php | 3 ++- app/Services/Pdf/PdfBuilder.php | 4 ++-- app/Services/Pdf/PdfMock.php | 4 ++-- app/Services/PdfMaker/Design.php | 2 +- app/Services/PdfMaker/PdfMaker.php | 7 +++---- app/Services/Template/TemplateService.php | 6 ++++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/DataMapper/Schedule/EmailReport.php b/app/DataMapper/Schedule/EmailReport.php index bb5c00996004..73a037fe1b67 100644 --- a/app/DataMapper/Schedule/EmailReport.php +++ b/app/DataMapper/Schedule/EmailReport.php @@ -73,12 +73,12 @@ class EmailReport public string $report_name = ''; - /** + /** * Optional array of report keys for * filter the columns of the report - * - * @var array $report_keys - * + * + * @var array $report_keys + * * */ public array $report_keys = []; @@ -89,9 +89,9 @@ class EmailReport public bool $include_tax = true; - /** - * Comma separated string of statuses for filtering the Invoice report - * + /** + * Comma separated string of statuses for filtering the Invoice report + * * all * draft * sent @@ -99,7 +99,7 @@ class EmailReport * unpaid * overdue * viewed - * + * * */ public string $status = ''; diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index b4fe782fd875..c750850572ee 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -928,11 +928,9 @@ class BaseController extends Controller } //allows us to selective display bank integrations back to the user if they can view / create bank transactions but without the bank balance being present in the response elseif($this->entity_type == TaxRate::class && $user->hasIntersectPermissions(['create_invoice','edit_invoice','create_quote','edit_quote','create_purchase_order','edit_purchase_order'])) { // need to show tax rates if the user has the ability to create documents. - } - elseif($this->entity_type == ExpenseCategory::class && $user->hasPermission('create_expense')) { + } elseif($this->entity_type == ExpenseCategory::class && $user->hasPermission('create_expense')) { // need to show expense categories if the user has the ability to create expenses. - } - else { + } else { $query->where('user_id', '=', $user->id); } } elseif (in_array($this->entity_type, [Design::class, GroupSetting::class, PaymentTerm::class, TaskStatus::class])) { diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 7829b1945d68..6083c136d9a7 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -248,7 +248,7 @@ class PreviewController extends BaseController $company = $user->company(); $design = \App\Models\Design::query() ->where('id', $request_data['design_id']) - ->where(function ($q) use ($user){ + ->where(function ($q) use ($user) { $q->whereNull('company_id')->orWhere('company_id', $user->companyId()); }) ->first(); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 10ca2a6b25bd..2311b62db572 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -68,7 +68,7 @@ class SearchController extends Controller 'type' => '/client', 'id' => $contact->client->hashed_id, 'path' => "/clients/{$contact->client->hashed_id}" - ]; + ]; }); } diff --git a/app/Jobs/Expense/VendorExpenseNotify.php b/app/Jobs/Expense/VendorExpenseNotify.php index c225910f8f6b..08e13c2bebcc 100644 --- a/app/Jobs/Expense/VendorExpenseNotify.php +++ b/app/Jobs/Expense/VendorExpenseNotify.php @@ -41,8 +41,9 @@ class VendorExpenseNotify implements ShouldQueue { MultiDB::setDB($this->db); - if(!$this->expense->vendor) + if(!$this->expense->vendor) { return; + } $this->expense->vendor->contacts->filter(function (VendorContact $contact) { return $contact->send_email && $contact->email; diff --git a/app/Services/Pdf/PdfBuilder.php b/app/Services/Pdf/PdfBuilder.php index c4d395056778..c871bf6ba5c4 100644 --- a/app/Services/Pdf/PdfBuilder.php +++ b/app/Services/Pdf/PdfBuilder.php @@ -624,7 +624,7 @@ class PdfBuilder $element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']]; } elseif ($cell == '$product.discount' && !$this->service->company->enable_product_discount) { $element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']]; - }elseif ($cell == '$task.hours') { + } elseif ($cell == '$task.hours') { $element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']]; } elseif ($cell == '$product.tax_rate1') { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']]; @@ -806,7 +806,7 @@ class PdfBuilder $elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($aliases[$column], 1) . '-th', 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]]; } elseif ($column == '$product.discount' && !$this->service->company->enable_product_discount) { $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']]; - }elseif ($column == '$product.tax_rate1') { + } elseif ($column == '$product.tax_rate1') { $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax1-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]]; } elseif ($column == '$product.tax_rate2') { $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax2-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]]; diff --git a/app/Services/Pdf/PdfMock.php b/app/Services/Pdf/PdfMock.php index cd188f379ea0..7cc2bd72a3b6 100644 --- a/app/Services/Pdf/PdfMock.php +++ b/app/Services/Pdf/PdfMock.php @@ -69,9 +69,9 @@ class PdfMock if(isset($this->request['design_id']) && $design = Design::withTrashed()->find($this->request['design_id'])) { $pdf_config->design = $design; $pdf_config->entity_design_id = $design->hashed_id; - } - else + } else { $pdf_config->design = Design::withTrashed()->find($this->decodePrimaryKey($pdf_config->entity_design_id)); + } $pdf_service->config = $pdf_config; diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 7d9f98652f70..656b41e2372a 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -799,7 +799,7 @@ class Design extends BaseDesign $element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']]; } elseif ($cell == '$product.discount' && !$this->company->enable_product_discount) { $element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']]; - } elseif ($cell == '$task.hours') { + } elseif ($cell == '$task.hours') { $element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']]; } elseif ($cell == '$product.tax_rate1') { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']]; diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index c13f1a974d85..89debbd9a39c 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -82,12 +82,11 @@ class PdfMaker $ts = new TemplateService(); - if(isset($this->data['template']['entity'])){ - try{ + if(isset($this->data['template']['entity'])) { + try { $entity = $this->data['template']['entity']; $ts->setCompany($entity->company); - } - catch(\Exception $e){ + } catch(\Exception $e) { } } diff --git a/app/Services/Template/TemplateService.php b/app/Services/Template/TemplateService.php index 81c613724bf5..90e4169d6ef6 100644 --- a/app/Services/Template/TemplateService.php +++ b/app/Services/Template/TemplateService.php @@ -179,11 +179,13 @@ class TemplateService private function getSettings(): object { - if($this->settings) + if($this->settings) { return $this->settings; + } - if($this->client) + if($this->client) { return $this->client->getMergedSettings(); + } return $this->company->settings; }