diff --git a/src/Services/InfoProviderSystem/DTOs/FileDTO.php b/src/Services/InfoProviderSystem/DTOs/FileDTO.php index 0d1db76a..84eed0c9 100644 --- a/src/Services/InfoProviderSystem/DTOs/FileDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/FileDTO.php @@ -28,12 +28,12 @@ namespace App\Services\InfoProviderSystem\DTOs; * This could be a datasheet, a 3D model, a picture or similar. * @see \App\Tests\Services\InfoProviderSystem\DTOs\FileDTOTest */ -class FileDTO +readonly class FileDTO { /** * @var string The URL where to get this file */ - public readonly string $url; + public string $url; /** * @param string $url The URL where to get this file @@ -41,7 +41,7 @@ class FileDTO */ public function __construct( string $url, - public readonly ?string $name = null, + public ?string $name = null, ) { //Find all occurrences of non URL safe characters and replace them with their URL encoded version. //We only want to replace characters which can not have a valid meaning in a URL (what would break the URL). @@ -50,4 +50,4 @@ class FileDTO } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php index 0b54d1a9..f5868039 100644 --- a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php @@ -28,17 +28,17 @@ namespace App\Services\InfoProviderSystem\DTOs; * This could be a voltage, a current, a temperature or similar. * @see \App\Tests\Services\InfoProviderSystem\DTOs\ParameterDTOTest */ -class ParameterDTO +readonly class ParameterDTO { public function __construct( - public readonly string $name, - public readonly ?string $value_text = null, - public readonly ?float $value_typ = null, - public readonly ?float $value_min = null, - public readonly ?float $value_max = null, - public readonly ?string $unit = null, - public readonly ?string $symbol = null, - public readonly ?string $group = null, + public string $name, + public ?string $value_text = null, + public ?float $value_typ = null, + public ?float $value_min = null, + public ?float $value_max = null, + public ?string $unit = null, + public ?string $symbol = null, + public ?string $group = null, ) { } diff --git a/src/Services/InfoProviderSystem/DTOs/PriceDTO.php b/src/Services/InfoProviderSystem/DTOs/PriceDTO.php index f1eb28f7..2acf3e57 100644 --- a/src/Services/InfoProviderSystem/DTOs/PriceDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/PriceDTO.php @@ -28,21 +28,21 @@ use Brick\Math\BigDecimal; /** * This DTO represents a price for a single unit in a certain discount range */ -class PriceDTO +readonly class PriceDTO { - private readonly BigDecimal $price_as_big_decimal; + private BigDecimal $price_as_big_decimal; public function __construct( /** @var float The minimum amount that needs to get ordered for this price to be valid */ - public readonly float $minimum_discount_amount, + public float $minimum_discount_amount, /** @var string The price as string (with .) */ - public readonly string $price, + public string $price, /** @var string The currency of the used ISO code of this price detail */ - public readonly ?string $currency_iso_code, + public ?string $currency_iso_code, /** @var bool If the price includes tax */ - public readonly ?bool $includes_tax = true, + public ?bool $includes_tax = true, /** @var float the price related quantity */ - public readonly ?float $price_related_quantity = 1.0, + public ?float $price_related_quantity = 1.0, ) { $this->price_as_big_decimal = BigDecimal::of($this->price); diff --git a/src/Services/InfoProviderSystem/DTOs/PurchaseInfoDTO.php b/src/Services/InfoProviderSystem/DTOs/PurchaseInfoDTO.php index bcd8be43..9ac142ff 100644 --- a/src/Services/InfoProviderSystem/DTOs/PurchaseInfoDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/PurchaseInfoDTO.php @@ -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 } } } -} \ No newline at end of file +}