Made classes readonly where possible

This commit is contained in:
Jan Böhmer 2025-09-21 14:25:57 +02:00
parent 27a18bdc1e
commit eda6deff47
4 changed files with 26 additions and 26 deletions

View file

@ -27,15 +27,15 @@ namespace App\Services\InfoProviderSystem\DTOs;
* This DTO represents a purchase information for a part (supplier name, order number and prices).
* @see \App\Tests\Services\InfoProviderSystem\DTOs\PurchaseInfoDTOTest
*/
class PurchaseInfoDTO
readonly class PurchaseInfoDTO
{
public function __construct(
public readonly string $distributor_name,
public readonly string $order_number,
public string $distributor_name,
public string $order_number,
/** @var PriceDTO[] */
public readonly array $prices,
public array $prices,
/** @var string|null An url to the product page of the vendor */
public readonly ?string $product_url = null,
public ?string $product_url = null,
)
{
//Ensure that the prices are PriceDTO instances
@ -45,4 +45,4 @@ class PurchaseInfoDTO
}
}
}
}
}