Skip to content

Commit

Permalink
refactor: make all DTOs readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafaznv committed Jan 16, 2024
1 parent f28c116 commit c18fc0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/DTOs/OptimizeResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Mostafaznv\PdfOptimizer\DTOs;


class OptimizeResult
readonly class OptimizeResult
{
public function __construct(
public bool $status,
Expand Down
20 changes: 10 additions & 10 deletions src/DTOs/PdfOptimizerJobData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

namespace Mostafaznv\PdfOptimizer\DTOs;


use Illuminate\Support\Str;
use Mostafaznv\PdfOptimizer\Laravel\Concerns\Disk;
use Mostafaznv\PdfOptimizer\Laravel\Concerns\File;
use Psr\Log\LoggerInterface;

class PdfOptimizerJobData

readonly class PdfOptimizerJobData
{
public function __construct(
public readonly string $id,
public readonly array $commands,
public readonly string $input,
public readonly string $output,
public readonly ?File $file = null,
public readonly ?Disk $disk = null,
public readonly ?LoggerInterface $logger = null,
public readonly int $timeout = 900
public string $id,
public array $commands,
public string $input,
public string $output,
public ?File $file = null,
public ?Disk $disk = null,
public ?LoggerInterface $logger = null,
public int $timeout = 900
) {}

public static function make(array $commands, string $input, string $output, File $file, ?Disk $disk = null, ?LoggerInterface $logger = null, int $timeout = 900): self
Expand Down
2 changes: 1 addition & 1 deletion src/DTOs/QueueData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Mostafaznv\PdfOptimizer\DTOs;


class QueueData
readonly class QueueData
{
public function __construct(
public bool $enabled = false,
Expand Down

0 comments on commit c18fc0a

Please sign in to comment.