-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefaultDt0.php
41 lines (35 loc) · 1.17 KB
/
DefaultDt0.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/*
* This file is part of fab2s/dt0.
* (c) Fabrice de Stefanis / https://github.com/fab2s/dt0
* This source file is licensed under the MIT license which you will
* find in the LICENSE file or at https://opensource.org/licenses/MIT
*/
namespace fab2s\Dt0\Tests\Artifacts;
use fab2s\Dt0\Attribute\Cast;
use fab2s\Dt0\Attribute\Casts;
use fab2s\Dt0\Dt0;
#[Casts(
new Cast(propName: 'stringCast'),
stringCastDefault: new Cast(default: 'casted'),
)]
class DefaultDt0 extends Dt0
{
public readonly string $stringNoCast;
public readonly string $stringCast;
public readonly string $stringCastDefault;
#[Cast(default: null)]
public readonly ?string $stringCastDefaultNull;
public function __construct(
public readonly string $stringNoCastDefault = 'default',
#[Cast(default: 'casted')]
public readonly string $stringDefaultCastDefault = 'default',
#[Cast(default: 'casted')]
public readonly ?string $stringDefaultNullCastDefault = null,
#[Cast(default: null)]
public readonly ?string $stringDefaultCastDefaultNull = 'default',
...$args,
) {
parent::__construct(...$args);
}
}