Marian Kostadinov ([stochnagara on Twitter](https://twitter.com/stochnagara)) replied to Friday's email about DTOs and value objects to tell me about `readonly` classes, which can be done in PHP 8.2.
Looking at the previous class:
```php
class AccountDetails {
public function __construct(
public readonly string $accountNumber,
public readonly string $sortCode,
) {}
}
```
Instead of setting each property as `readonly`, the whole class can instead be marked as `readonly`: