- Spatie/DataTransferObject 대비
- MapFrom,MapTo -> RawName
- Strict -> 항상
- 심지어 raw type도 더 까다롭게
- array에 MapConverter 적용
- NullIsUndefined 적용
- 빈 nullable arg자리에 null 강제 지정
- Vue3에 v-model.number 지정
- input type="number" 기준
19 lines
348 B
PHP
19 lines
348 B
PHP
<?php
|
|
|
|
namespace sammo\DTO;
|
|
|
|
use sammo\DTO\Attr\Convert;
|
|
use sammo\DTO\Converter\MapConverter;
|
|
|
|
class SelectItem extends DTO
|
|
{
|
|
public function __construct(
|
|
public string $title,
|
|
public ?string $info,
|
|
public ?bool $isHtml,
|
|
#[Convert(MapConverter::class, ['string', 'int', 'float', 'array', 'null', 'bool'])]
|
|
public ?array $aux,
|
|
) {
|
|
}
|
|
}
|