mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
Add return types, typed parameters, and PHPDoc to all model methods
Modernize all 16 models with missing type declarations: - Return types on ~87 methods (string, bool, void, array, mixed, etc.) - Typed parameters where missing - PHPDoc blocks on non-obvious methods explaining their purpose Models updated: Invoice, Estimate, Payment, User, Company, Customer, RecurringInvoice, Setting, CompanySetting, FileDisk, Transaction, EmailLog, ExchangeRateLog, PaymentMethod, CustomField, CustomFieldValue.
This commit is contained in:
@@ -93,7 +93,10 @@ class PaymentMethod extends Model
|
||||
return $query->paginate($limit);
|
||||
}
|
||||
|
||||
public static function createPaymentMethod($request)
|
||||
/**
|
||||
* Create a new payment method from a validated form request.
|
||||
*/
|
||||
public static function createPaymentMethod(mixed $request): self
|
||||
{
|
||||
$data = $request->getPaymentMethodPayload();
|
||||
|
||||
@@ -102,7 +105,10 @@ class PaymentMethod extends Model
|
||||
return $paymentMethod;
|
||||
}
|
||||
|
||||
public static function getSettings($id)
|
||||
/**
|
||||
* Retrieve the settings array for a payment method by its ID.
|
||||
*/
|
||||
public static function getSettings(int $id): mixed
|
||||
{
|
||||
$settings = PaymentMethod::find($id)
|
||||
->settings;
|
||||
|
||||
Reference in New Issue
Block a user