mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-16 16:37:47 +00:00
chore: phpstan fixes, rector
This commit is contained in:
parent
d19a079b8a
commit
b097b0a7d7
7 changed files with 15 additions and 17 deletions
|
|
@ -61,9 +61,9 @@ class ImageGenerationService
|
|||
|
||||
try {
|
||||
// Get image generation settings from DeviceModel or Device (for legacy devices)
|
||||
$imageSettings = $deviceModel
|
||||
$imageSettings = $deviceModel instanceof DeviceModel
|
||||
? self::getImageSettingsFromModel($deviceModel)
|
||||
: ($device ? self::getImageSettings($device) : self::getImageSettingsFromModel(null));
|
||||
: ($device instanceof Device ? self::getImageSettings($device) : self::getImageSettingsFromModel(null));
|
||||
|
||||
$fileExtension = $imageSettings['mime_type'] === 'image/bmp' ? 'bmp' : 'png';
|
||||
$outputPath = Storage::disk('public')->path('/images/generated/'.$uuid.'.'.$fileExtension);
|
||||
|
|
@ -78,7 +78,7 @@ class ImageGenerationService
|
|||
$browserStage->html($markup);
|
||||
|
||||
// Set timezone from user or fall back to app timezone
|
||||
$timezone = $user?->timezone ?? config('app.timezone');
|
||||
$timezone = $user->timezone ?? config('app.timezone');
|
||||
$browserStage->timezone($timezone);
|
||||
|
||||
if (config('app.puppeteer_window_size_strategy') === 'v2') {
|
||||
|
|
@ -186,7 +186,7 @@ class ImageGenerationService
|
|||
*/
|
||||
private static function getImageSettingsFromModel(?DeviceModel $deviceModel): array
|
||||
{
|
||||
if ($deviceModel) {
|
||||
if ($deviceModel instanceof DeviceModel) {
|
||||
return [
|
||||
'width' => $deviceModel->width,
|
||||
'height' => $deviceModel->height,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue