Reformat with pint

This commit is contained in:
Darko Gjorgjijoski
2025-01-12 18:37:08 +01:00
parent 34b9f52af7
commit e9e52c60a7
32 changed files with 87 additions and 89 deletions

View File

@@ -80,7 +80,7 @@ class BackupsController extends ApiController
$this->authorize('manage backups');
$validated = $request->validate([
'path' => ['required', new PathToZip()],
'path' => ['required', new PathToZip],
]);
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));

View File

@@ -18,7 +18,7 @@ class DownloadBackupController extends ApiController
$this->authorize('manage backups');
$validated = $request->validate([
'path' => ['required', new PathToZip()],
'path' => ['required', new PathToZip],
]);
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));

View File

@@ -24,7 +24,7 @@ class CloneEstimateController extends Controller
$date = Carbon::now();
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($estimate)
->setCompany($estimate->company_id)
->setCustomer($estimate->customer_id)

View File

@@ -42,7 +42,7 @@ class ConvertEstimateController extends Controller
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
}
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($invoice)
->setCompany($estimate->company_id)
->setCustomer($estimate->customer_id)

View File

@@ -20,7 +20,7 @@ class NextNumberController extends Controller
{
$key = $request->key;
$nextNumber = null;
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setCompany($request->header('company'))
->setCustomer($request->userId);

View File

@@ -24,7 +24,7 @@ class CloneInvoiceController extends Controller
$date = Carbon::now();
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($invoice)
->setCompany($invoice->company_id)
->setCustomer($invoice->customer_id)

View File

@@ -13,7 +13,7 @@ class AppDomainController extends Controller
{
Artisan::call('optimize:clear');
$environmentManager = new EnvironmentManager();
$environmentManager = new EnvironmentManager;
$results = $environmentManager->saveDomainVariables($request);

View File

@@ -227,7 +227,7 @@ class Estimate extends Model implements HasMedia
$estimate = self::create($data);
$estimate->unique_hash = Hashids::connection(Estimate::class)->encode($estimate->id);
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($estimate)
->setCompany($estimate->company_id)
->setCustomer($estimate->customer_id)
@@ -262,7 +262,7 @@ class Estimate extends Model implements HasMedia
{
$data = $request->getEstimatePayload();
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($this)
->setCompany($this->company_id)
->setCustomer($request->customer_id)

View File

@@ -323,7 +323,7 @@ class Invoice extends Model implements HasMedia
$invoice = Invoice::create($data);
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($invoice)
->setCompany($invoice->company_id)
->setCustomer($invoice->customer_id)
@@ -364,7 +364,7 @@ class Invoice extends Model implements HasMedia
public function updateInvoice($request)
{
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($this)
->setCompany($this->company_id)
->setCustomer($request->customer_id)

View File

@@ -163,7 +163,7 @@ class Payment extends Model implements HasMedia
$payment = Payment::create($data);
$payment->unique_hash = Hashids::connection(Payment::class)->encode($payment->id);
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($payment)
->setCompany($payment->company_id)
->setCustomer($payment->customer_id)
@@ -215,7 +215,7 @@ class Payment extends Model implements HasMedia
$invoice->subtractInvoicePayment($request->amount);
}
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($this)
->setCompany($this->company_id)
->setCustomer($request->customer_id)
@@ -452,8 +452,8 @@ class Payment extends Model implements HasMedia
{
$invoice = Invoice::find($transaction->invoice_id);
$serial = (new SerialNumberFormatter())
->setModel(new Payment())
$serial = (new SerialNumberFormatter)
->setModel(new Payment)
->setCompany($invoice->company_id)
->setCustomer($invoice->customer_id)
->setNextNumbers();

View File

@@ -307,9 +307,9 @@ class RecurringInvoice extends Model
public function createInvoice()
{
//get invoice_number
$serial = (new SerialNumberFormatter())
->setModel(new Invoice())
// get invoice_number
$serial = (new SerialNumberFormatter)
->setModel(new Invoice)
->setCompany($this->company_id)
->setCustomer($this->customer_id)
->setNextNumbers();
@@ -375,7 +375,7 @@ class RecurringInvoice extends Model
$invoice->addCustomFields($customField);
}
//send automatically
// send automatically
if ($this->send_automatically == true) {
$data = [
'body' => CompanySetting::getSetting('invoice_mail_body', $this->company_id),

View File

@@ -22,7 +22,7 @@ class Setting extends Model
return;
}
$set = new Setting();
$set = new Setting;
$set->option = $key;
$set->value = $setting;
$set->save();

View File

@@ -40,7 +40,7 @@ class CustomerMailResetPasswordNotification extends ResetPassword
{
$link = url("/{$notifiable->company->slug}/customer/reset/password/".$this->token);
return (new MailMessage())
return (new MailMessage)
->subject('Reset Password Notification')
->line('Hello! You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', $link)

View File

@@ -40,7 +40,7 @@ class MailResetPasswordNotification extends ResetPassword
{
$link = url('/reset-password/'.$this->token);
return (new MailMessage())
return (new MailMessage)
->subject('Reset Password Notification')
->line('Hello! You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', $link)

View File

@@ -78,14 +78,14 @@ class AppServiceProvider extends ServiceProvider
public function addMenus()
{
//main menu
// main menu
\Menu::make('main_menu', function ($menu) {
foreach (config('invoiceshelf.main_menu') as $data) {
$this->generateMenu($menu, $data);
}
});
//setting menu
// setting menu
\Menu::make('setting_menu', function ($menu) {
foreach (config('invoiceshelf.setting_menu') as $data) {
$this->generateMenu($menu, $data);

View File

@@ -36,7 +36,7 @@ class Module
{
static::$scripts[$name] = $path;
return new static();
return new static;
}
/**
@@ -50,7 +50,7 @@ class Module
{
static::$styles[$name] = $path;
return new static();
return new static;
}
/**

View File

@@ -153,7 +153,7 @@ class ModuleInstaller
File::makeDirectory($temp_extract_dir);
}
// Unzip the file
$zip = new ZipArchive();
$zip = new ZipArchive;
if ($zip->open($zip_file_path)) {
$zip->extractTo($temp_extract_dir);

View File

@@ -93,7 +93,7 @@ class Updater
File::makeDirectory($temp_extract_dir);
}
// Unzip the file
$zip = new ZipArchive();
$zip = new ZipArchive;
if ($zip->open($zip_file_path)) {
$zip->extractTo($temp_extract_dir);

View File

@@ -111,9 +111,9 @@ trait GeneratesPdfTrait
public function getFieldsArray()
{
$customer = $this->customer;
$shippingAddress = $customer->shippingAddress ?? new Address();
$billingAddress = $customer->billingAddress ?? new Address();
$companyAddress = $this->company->address ?? new Address();
$shippingAddress = $customer->shippingAddress ?? new Address;
$billingAddress = $customer->billingAddress ?? new Address;
$companyAddress = $this->company->address ?? new Address;
$fields = [
'{SHIPPING_ADDRESS_NAME}' => $shippingAddress->name,