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:
@@ -190,7 +190,7 @@ class RecurringInvoice extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public function markStatusAsCompleted()
|
||||
public function markStatusAsCompleted(): void
|
||||
{
|
||||
if ($this->status == $this->status) {
|
||||
$this->status = self::COMPLETED;
|
||||
@@ -198,14 +198,14 @@ class RecurringInvoice extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public static function getNextInvoiceDate($frequency, $starts_at)
|
||||
public static function getNextInvoiceDate(string $frequency, string $starts_at): string
|
||||
{
|
||||
$cron = new Cron\CronExpression($frequency);
|
||||
|
||||
return $cron->getNextRunDate($starts_at)->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function updateNextInvoiceDate()
|
||||
public function updateNextInvoiceDate(): void
|
||||
{
|
||||
$nextInvoiceAt = self::getNextInvoiceDate($this->frequency, $this->starts_at);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user