mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-16 22:49:36 +00:00
Made classes readonly where possible
This commit is contained in:
parent
27a18bdc1e
commit
eda6deff47
4 changed files with 26 additions and 26 deletions
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue