Changeset View
Changeset View
Standalone View
Standalone View
src/app/Documents/Receipt.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | class Receipt | ||||
* @param string $type Output format ('html' or 'pdf') | * @param string $type Output format ('html' or 'pdf') | ||||
* | * | ||||
* @return string HTML or PDF output | * @return string HTML or PDF output | ||||
*/ | */ | ||||
public static function fakeRender(string $type = 'html'): string | public static function fakeRender(string $type = 'html'): string | ||||
{ | { | ||||
$wallet = new Wallet(); | $wallet = new Wallet(); | ||||
$wallet->id = \App\Utils::uuidStr(); | $wallet->id = \App\Utils::uuidStr(); | ||||
$wallet->owner = new User(['id' => 123456789]); // @phpstan-ignore-line | $wallet->owner = new User(['id' => 123456789]); | ||||
$receipt = new self($wallet, date('Y'), date('n')); | $receipt = new self($wallet, date('Y'), date('n')); | ||||
self::$fakeMode = true; | self::$fakeMode = true; | ||||
if ($type == 'pdf') { | if ($type == 'pdf') { | ||||
return $receipt->pdfOutput(); | return $receipt->pdfOutput(); | ||||
} elseif ($type !== 'html') { | } elseif ($type !== 'html') { | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |