Repository navigation
Notable changes
PHP 8.6 support 🐘
PHP 8.6 is released today, and the library supports it from day one!
Since this version, a readonly property can be declared with a default value: it is initialized when the object is instantiated and cannot be written again. Such a property is not part of the mapped values: it keeps its default value, and a value given for it in the source is reported as an unexpected key.
final class Article
{
public readonly string $status = 'draft';
public string $title;
}
$article = (new \CuyZ\Valinor\MapperBuilder())
->mapper()
->map(Article::class, ['title' => 'Hello world']);
$article->status; // 'draft'Features
- Add support for PHP 8.6 (c6694f)